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.
diff --git a/src/ProtoGen/PrimitiveFieldGenerator.cs b/src/ProtoGen/PrimitiveFieldGenerator.cs
index ed7d0dc..ad0ab8d 100644
--- a/src/ProtoGen/PrimitiveFieldGenerator.cs
+++ b/src/ProtoGen/PrimitiveFieldGenerator.cs
@@ -103,7 +103,7 @@
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("}");
}