Merge pull request #1792 from pingcap/shenli/kv-cleanup
kv: Tiny cleanup
This commit is contained in:
11
kv/key.go
11
kv/key.go
@ -70,6 +70,17 @@ func (k Key) Clone() Key {
|
||||
return append([]byte(nil), k...)
|
||||
}
|
||||
|
||||
// KeyRange represents a range where StartKey <= key < EndKey.
|
||||
type KeyRange struct {
|
||||
StartKey Key
|
||||
EndKey Key
|
||||
}
|
||||
|
||||
// IsPoint checks if the key range represents a point.
|
||||
func (r *KeyRange) IsPoint() bool {
|
||||
return bytes.Equal(r.StartKey.PrefixNext(), r.EndKey)
|
||||
}
|
||||
|
||||
// EncodedKey represents encoded key in low-level storage engine.
|
||||
type EncodedKey []byte
|
||||
|
||||
|
||||
12
kv/kv.go
12
kv/kv.go
@ -14,7 +14,6 @@
|
||||
package kv
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
)
|
||||
|
||||
@ -111,17 +110,6 @@ const (
|
||||
ReqSubTypeTopN = 10002
|
||||
)
|
||||
|
||||
// KeyRange represents a range where StartKey <= key < EndKey.
|
||||
type KeyRange struct {
|
||||
StartKey Key
|
||||
EndKey Key
|
||||
}
|
||||
|
||||
// IsPoint checks if the key range represents a point.
|
||||
func (r *KeyRange) IsPoint() bool {
|
||||
return bytes.Equal(r.StartKey.PrefixNext(), r.EndKey)
|
||||
}
|
||||
|
||||
// Request represents a kv request.
|
||||
type Request struct {
|
||||
// The request type.
|
||||
|
||||
Reference in New Issue
Block a user