File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -107,11 +107,9 @@ func (b *Buffer) Reset() {
107
107
// Note that this is less performant than calling c.Sort() because
108
108
// a new buffer will be allocated for each call.
109
109
func (c * Collator ) Compare (a , b []byte ) int {
110
- var (
111
- kA = c .Key (& c .buf , a )
112
- kB = c .Key (& c .buf , b )
113
- ret = bytes .Compare (kA , kB )
114
- )
110
+ kA := c .Key (& c .buf , a )
111
+ kB := c .Key (& c .buf , b )
112
+ ret := bytes .Compare (kA , kB )
115
113
c .buf .Reset ()
116
114
return ret
117
115
}
@@ -121,11 +119,9 @@ func (c *Collator) Compare(a, b []byte) int {
121
119
// Note that this is less performant than calling c.Sort() because
122
120
// a new buffer will be allocated for each call.
123
121
func (c * Collator ) CompareString (a , b string ) int {
124
- var (
125
- kA = c .KeyFromString (& c .buf , a )
126
- kB = c .KeyFromString (& c .buf , b )
127
- ret = bytes .Compare (kA , kB )
128
- )
122
+ kA := c .KeyFromString (& c .buf , a )
123
+ kB := c .KeyFromString (& c .buf , b )
124
+ ret := bytes .Compare (kA , kB )
129
125
c .buf .Reset ()
130
126
return ret
131
127
}
You can’t perform that action at this time.
0 commit comments