Skip to content

Commit

Permalink
merged in golang/protobuf commit 78db94dd5472afd7bbe7d5f07bc5a13dc923…
Browse files Browse the repository at this point in the history
…82a6 - proto: replace exprs with matching consts from math pkg
  • Loading branch information
jmarais committed Dec 30, 2018
1 parent 463423b commit ec905a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions proto/size2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package proto

import (
"math"
"testing"
)

Expand All @@ -51,8 +52,8 @@ func TestVarintSize(t *testing.T) {
{128, 2},
{16383, 2},
{16384, 3},
{1<<63 - 1, 9},
{1 << 63, 10},
{math.MaxInt64, 9},
{math.MaxInt64 + 1, 10},
}
for _, tc := range testCases {
size := SizeVarint(tc.n)
Expand Down
2 changes: 1 addition & 1 deletion proto/table_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) {

func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
fi.field = toField(f)
fi.wiretag = 1<<31 - 1 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
fi.isPointer = true
fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
Expand Down

0 comments on commit ec905a6

Please sign in to comment.