Skip to content

Commit 086270d

Browse files
committed
var -> :=
1 parent 14ca72f commit 086270d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

collate/collate.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ func (b *Buffer) Reset() {
107107
// Note that this is less performant than calling c.Sort() because
108108
// a new buffer will be allocated for each call.
109109
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)
115113
c.buf.Reset()
116114
return ret
117115
}
@@ -121,11 +119,9 @@ func (c *Collator) Compare(a, b []byte) int {
121119
// Note that this is less performant than calling c.Sort() because
122120
// a new buffer will be allocated for each call.
123121
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)
129125
c.buf.Reset()
130126
return ret
131127
}

0 commit comments

Comments
 (0)