diff options
author | Jon Skeet <skeet@pobox.com> | 2015-06-28 21:53:16 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2015-06-28 21:53:16 +0100 |
commit | b08b6bf62e5f0398609cc95a34699df500ea110c (patch) | |
tree | 430514e0a7f98dd195d720e2a90a9f3183808fb7 /csharp/src/ProtocolBuffers/Collections/RepeatedField.cs | |
parent | 6b01539dfc1b4d4cefadc4cfdc79ff17293b84be (diff) | |
parent | fb77cc9d9f066a8ce4f12e8d5f76188d48101444 (diff) | |
download | protobuf-b08b6bf62e5f0398609cc95a34699df500ea110c.tar.gz protobuf-b08b6bf62e5f0398609cc95a34699df500ea110c.tar.bz2 protobuf-b08b6bf62e5f0398609cc95a34699df500ea110c.zip |
Merge pull request #544 from jskeet/csharp-cleanup
Clean up C# code
Diffstat (limited to 'csharp/src/ProtocolBuffers/Collections/RepeatedField.cs')
-rw-r--r-- | csharp/src/ProtocolBuffers/Collections/RepeatedField.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs b/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs index 4d4212cb..39d4f351 100644 --- a/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs +++ b/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs @@ -298,6 +298,16 @@ namespace Google.Protobuf.Collections } } + internal uint CalculateSize(Func<T, int> sizeComputer) + { + int size = 0; + for (int i = 0; i < count; i++) + { + size += sizeComputer(array[i]); + } + return (uint)size; + } + public struct Enumerator : IEnumerator<T> { private int index; |