Avoid creating UnknownFieldSets unless we really have to.
diff --git a/src/ProtocolBuffers/WireFormat.cs b/src/ProtocolBuffers/WireFormat.cs
index 2bd0a5a..8f723d5 100644
--- a/src/ProtocolBuffers/WireFormat.cs
+++ b/src/ProtocolBuffers/WireFormat.cs
@@ -91,6 +91,10 @@
return (WireType) (tag & TagTypeMask);
}
+ public static bool IsEndGroupTag(uint tag) {
+ return (WireType)(tag & TagTypeMask) == WireType.EndGroup;
+ }
+
/// <summary>
/// Given a tag value, determines the field number (the upper 29 bits).
/// </summary>