Skip to content

Commit

Permalink
tablecodec: correct comments mistake (pingcap#3122)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongyuanw authored and XuHuaiyu committed Apr 24, 2017
1 parent 8c51d4b commit 1685dcb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions tablecodec/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func BenchmarkEncodeEndKey(b *testing.B) {
}
}

// BenchmarkEncodeRowKeyWithPrefixNex tests the performance of encoding row key with prefixNext
// PrefixNext() is slow than using EncodeRowKeyWithHandle.
// BenchmarkEncodeEndKey-4 20000000 97.2 ns/op
// BenchmarkEncodeRowKeyWithPrefixNex-4 10000000 121 ns/op
Expand Down
4 changes: 2 additions & 2 deletions tablecodec/tablecodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,15 @@ func EncodeTablePrefix(tableID int64) kv.Key {
return key
}

// Record prefix is "t[tableID]_r".
// appendTableRecordPrefix appends table record prefix "t[tableID]_r".
func appendTableRecordPrefix(buf []byte, tableID int64) []byte {
buf = append(buf, tablePrefix...)
buf = codec.EncodeInt(buf, tableID)
buf = append(buf, recordPrefixSep...)
return buf
}

// Index prefix is "t[tableID]_i".
// appendTableIndexPrefix appends table index prefix "t[tableID]_i".
func appendTableIndexPrefix(buf []byte, tableID int64) []byte {
buf = append(buf, tablePrefix...)
buf = codec.EncodeInt(buf, tableID)
Expand Down
1 change: 1 addition & 0 deletions tablecodec/tablecodec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var _ = Suite(&testTableCodecSuite{})

type testTableCodecSuite struct{}

// TestTableCodec tests some functions in package tablecodec
// TODO: add more tests.
func (s *testTableCodecSuite) TestTableCodec(c *C) {
defer testleak.AfterTest(c)()
Expand Down

0 comments on commit 1685dcb

Please sign in to comment.