aboutsummaryrefslogtreecommitdiff
path: root/src/ProtoGen/PrimitiveFieldGenerator.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-06-03 11:57:47 -0500
committerrogerk <devnull@localhost>2011-06-03 11:57:47 -0500
commit90922db77aef8bd7f21e7a87a75d86885da8dbbc (patch)
treeb86202690d68a01341c2232477657a4da27f7375 /src/ProtoGen/PrimitiveFieldGenerator.cs
parent8a2d0f48d70bd760bf26218f7107c86ca9f91cce (diff)
downloadprotobuf-90922db77aef8bd7f21e7a87a75d86885da8dbbc.tar.gz
protobuf-90922db77aef8bd7f21e7a87a75d86885da8dbbc.tar.bz2
protobuf-90922db77aef8bd7f21e7a87a75d86885da8dbbc.zip
Added the field name to all CodedOutputStream.Write??? calls
Refactored 'speed' generated write of arrays to call Write???Array. This may have impacted speed write speeds for arrays of non-reference types due to the use of non-generic IEnumerable and the subsequent boxing of value types. This could be addressed later if desired.
Diffstat (limited to 'src/ProtoGen/PrimitiveFieldGenerator.cs')
-rw-r--r--src/ProtoGen/PrimitiveFieldGenerator.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ProtoGen/PrimitiveFieldGenerator.cs b/src/ProtoGen/PrimitiveFieldGenerator.cs
index ed7d0dc1..ad0ab8d4 100644
--- a/src/ProtoGen/PrimitiveFieldGenerator.cs
+++ b/src/ProtoGen/PrimitiveFieldGenerator.cs
@@ -103,7 +103,7 @@ namespace Google.ProtocolBuffers.ProtoGen
public void GenerateSerializationCode(TextGenerator writer)
{
writer.WriteLine("if (Has{0}) {{", PropertyName);
- writer.WriteLine(" output.Write{0}({1}, {2});", CapitalizedTypeName, Number, PropertyName);
+ writer.WriteLine(" output.Write{0}({1}, \"{3}\", {2});", CapitalizedTypeName, Number, PropertyName, Descriptor.Name);
writer.WriteLine("}");
}