Merge pull request #1792 from pingcap/shenli/kv-cleanup

kv: Tiny cleanup
This commit is contained in:
dongxu
2016-10-04 23:43:50 +08:00
committed by GitHub
2 changed files with 11 additions and 12 deletions

View File

@ -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

View File

@ -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.