Merge pull request #605 from jtattermusch/csharp_cleanup

Assorted nits from C# code.
pull/603/merge
Jon Skeet 10 years ago
commit 3bf74a91bb
  1. 2
      csharp/src/ProtocolBuffers/ByteString.cs
  2. 3
      csharp/src/ProtocolBuffers/Collections/RepeatedField.cs
  3. 1
      csharp/src/ProtocolBuffers/FrameworkPortability.cs
  4. 6
      csharp/src/ProtocolBuffers/InvalidProtocolBufferException.cs
  5. 1
      csharp/src/ProtocolBuffers/ProtocolBuffers.csproj
  6. 2
      csharp/src/ProtocolBuffers/Reflection/IFieldAccessor.cs

@ -134,6 +134,8 @@ namespace Google.Protobuf
/// Constructs a ByteString from the given array. The contents
/// are copied, so further modifications to the array will not
/// be reflected in the returned ByteString.
/// This method can also be invoked in <c>ByteString.CopyFrom(0xaa, 0xbb, ...)</c> form
/// which is primarily useful for testing.
/// </summary>
public static ByteString CopyFrom(params byte[] bytes)
{

@ -44,9 +44,9 @@ namespace Google.Protobuf.Collections
public sealed class RepeatedField<T> : IList<T>, IList, IDeepCloneable<RepeatedField<T>>, IEquatable<RepeatedField<T>>, IFreezable
{
private static readonly T[] EmptyArray = new T[0];
private const int MinArraySize = 8;
private bool frozen;
private const int MinArraySize = 8;
private T[] array = EmptyArray;
private int count = 0;
@ -259,7 +259,6 @@ namespace Google.Protobuf.Collections
public int Count { get { return count; } }
// TODO(jonskeet): If we implement freezing, make this reflect it.
public bool IsReadOnly { get { return IsFrozen; } }
public void Add(RepeatedField<T> values)

@ -40,6 +40,7 @@ namespace Google.Protobuf
/// </summary>
internal static class FrameworkPortability
{
// TODO(jtattermusch): is this still a thing?
// The value of RegexOptions.Compiled is 8. We can test for the presence at
// execution time using Enum.IsDefined, so a single build will do the right thing
// on each platform.

@ -79,12 +79,6 @@ namespace Google.Protobuf
"Protocol message end-group tag did not match expected tag.");
}
internal static InvalidProtocolBufferException InvalidWireType()
{
return new InvalidProtocolBufferException(
"Protocol message tag had invalid wire type.");
}
internal static InvalidProtocolBufferException RecursionLimitExceeded()
{
return new InvalidProtocolBufferException(

@ -111,7 +111,6 @@
<ItemGroup>
<None Include="Google.Protobuf.nuspec" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

@ -42,7 +42,7 @@ namespace Google.Protobuf.Reflection
/// </summary>
FieldDescriptor Descriptor { get; }
// TODO: Should the argument type for these messages by IReflectedMessage?
// TODO: Should the argument type for these messages be IReflectedMessage?
/// <summary>
/// Clears the field in the specified message. (For repeated fields,

Loading…
Cancel
Save