Skip to content

Commit aa51041

Browse files
committedJun 26, 2015
Remove a lot of code which wasn't needed any more.
1 parent e75a10d commit aa51041

22 files changed

+59
-1154
lines changed
 

‎csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs

-5
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,14 @@ public void FieldDescriptor()
147147
Assert.AreEqual(messageType, primitiveField.ContainingType);
148148
Assert.AreEqual(UnittestProto3.Descriptor, primitiveField.File);
149149
Assert.AreEqual(FieldType.Int32, primitiveField.FieldType);
150-
Assert.AreEqual(MappedType.Int32, primitiveField.MappedType);
151150
Assert.IsNull(primitiveField.Options);
152151

153152
Assert.AreEqual("single_nested_enum", enumField.Name);
154153
Assert.AreEqual(FieldType.Enum, enumField.FieldType);
155-
Assert.AreEqual(MappedType.Enum, enumField.MappedType);
156154
// Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType);
157155

158156
Assert.AreEqual("single_foreign_message", messageField.Name);
159157
Assert.AreEqual(FieldType.Message, messageField.FieldType);
160-
Assert.AreEqual(MappedType.Message, messageField.MappedType);
161158
Assert.AreEqual(ForeignMessage.Descriptor, messageField.MessageType);
162159
}
163160

@@ -169,9 +166,7 @@ public void FieldDescriptorLabel()
169166
FieldDescriptor repeatedField =
170167
TestAllTypes.Descriptor.FindDescriptor<FieldDescriptor>("repeated_int32");
171168

172-
Assert.IsFalse(singleField.IsRequired);
173169
Assert.IsFalse(singleField.IsRepeated);
174-
Assert.IsFalse(repeatedField.IsRequired);
175170
Assert.IsTrue(repeatedField.IsRepeated);
176171
}
177172

‎csharp/src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
<Compile Include="IssuesTest.cs" />
9090
<Compile Include="Properties\AssemblyInfo.cs" />
9191
<Compile Include="TestCornerCases.cs" />
92-
<Compile Include="WireFormatTest.cs" />
9392
</ItemGroup>
9493
<ItemGroup>
9594
<ProjectReference Include="..\ProtocolBuffers\ProtocolBuffers.csproj">

‎csharp/src/ProtocolBuffers.Test/WireFormatTest.cs

-60
This file was deleted.

‎csharp/src/ProtocolBuffers/ByteArray.cs

+5-13
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,11 @@ internal static void Copy(byte[] src, int srcOffset, byte[] dst, int dstOffset,
5959
}
6060
else
6161
{
62-
ByteCopy(src, srcOffset, dst, dstOffset, count);
63-
}
64-
}
65-
66-
/// <summary>
67-
/// Copy the bytes provided with a for loop, faster when there are only a few bytes to copy
68-
/// </summary>
69-
internal static void ByteCopy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count)
70-
{
71-
int stop = srcOffset + count;
72-
for (int i = srcOffset; i < stop; i++)
73-
{
74-
dst[dstOffset++] = src[i];
62+
int stop = srcOffset + count;
63+
for (int i = srcOffset; i < stop; i++)
64+
{
65+
dst[dstOffset++] = src[i];
66+
}
7567
}
7668
}
7769

‎csharp/src/ProtocolBuffers/ByteString.cs

-32
Original file line numberDiff line numberDiff line change
@@ -264,38 +264,6 @@ public bool Equals(ByteString other)
264264
return true;
265265
}
266266

267-
/// <summary>
268-
/// Builder for ByteStrings which allows them to be created without extra
269-
/// copying being involved. This has to be a nested type in order to have access
270-
/// to the private ByteString constructor.
271-
/// </summary>
272-
internal sealed class CodedBuilder
273-
{
274-
private readonly CodedOutputStream output;
275-
private readonly byte[] buffer;
276-
277-
internal CodedBuilder(int size)
278-
{
279-
buffer = new byte[size];
280-
output = CodedOutputStream.CreateInstance(buffer);
281-
}
282-
283-
internal ByteString Build()
284-
{
285-
output.CheckNoSpaceLeft();
286-
287-
// We can be confident that the CodedOutputStream will not modify the
288-
// underlying bytes anymore because it already wrote all of them. So,
289-
// no need to make a copy.
290-
return new ByteString(buffer);
291-
}
292-
293-
internal CodedOutputStream CodedOutput
294-
{
295-
get { return output; }
296-
}
297-
}
298-
299267
/// <summary>
300268
/// Used internally by CodedOutputStream to avoid creating a copy for the write
301269
/// </summary>

‎csharp/src/ProtocolBuffers/Collections/Dictionaries.cs

-122
This file was deleted.

‎csharp/src/ProtocolBuffers/Collections/Enumerables.cs

-74
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.