commit | 14aad3d5ea4c323bcd7a2137e735da24a76e814c | [log] [tgz] |
---|---|---|
author | David Howden <dhowden@gmail.com> | Sun Jul 15 18:23:32 2018 +1000 |
committer | Joe Tsai <joetsai@digital-static.net> | Sun Jul 15 01:23:32 2018 -0700 |
tree | 0796d54f57f873016c9249a192037dd2f8e13347 | |
parent | 70b3af33377e7aa25ae42977bed93cc6b90f0373 [diff] |
jsonpb: avoid copying string-valued map-keys (#654)
diff --git a/jsonpb/jsonpb.go b/jsonpb/jsonpb.go index 2ba5121..57cde15 100644 --- a/jsonpb/jsonpb.go +++ b/jsonpb/jsonpb.go
@@ -1116,6 +1116,8 @@ func (s mapKeys) Less(i, j int) bool { if k := s[i].Kind(); k == s[j].Kind() { switch k { + case reflect.String: + return s[i].String() < s[j].String() case reflect.Int32, reflect.Int64: return s[i].Int() < s[j].Int() case reflect.Uint32, reflect.Uint64: