Skip to content

Commit

Permalink
Merge pull request pingcap#1792 from pingcap/shenli/kv-cleanup
Browse files Browse the repository at this point in the history
kv: Tiny cleanup
  • Loading branch information
c4pt0r authored Oct 4, 2016
2 parents 1a83e04 + bb2a146 commit a14f27c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 11 additions & 0 deletions kv/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions kv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package kv

import (
"bytes"
"io"
)

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a14f27c

Please sign in to comment.