Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
diff --git a/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs b/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
index 9831308882b08e9fdd7b67bdd38b3c48c06d3dc2..c28b47e1eb76f327d3461623db6f6290da850091 100644
--- a/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
+++ b/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
@@ -347,7 +347,8 @@ namespace Google.Protobuf
public sealed class FieldCodec<T>
{
private static readonly T DefaultDefault;
- private static readonly bool TypeSupportsPacking = typeof(T).IsValueType() && Nullable.GetUnderlyingType(typeof(T)) == null;
+ // Only non-nullable value types support packing. This is the simplest way of detecting that.
+ private static readonly bool TypeSupportsPacking = default(T) != null;
static FieldCodec()
{

Powered by Google App Engine
This is Rietveld 408576698