Skip to content

Commit

Permalink
Make skiplist grow (dgraph-io#1695)
Browse files Browse the repository at this point in the history
This change makes the skiplist grow for the case of sorted
skiplist builder. The normal skiplist still cannot grow.
Note: The growing skiplist is not thread safe.

Co-authored-by: Ahsan Barkati <[email protected]>
  • Loading branch information
2 people authored and fredcarle committed Aug 1, 2023
1 parent f2388bc commit 33ca02f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions skl/skl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func newValue(v int) []byte {

// length iterates over skiplist to give exact size.
func length(s *Skiplist) int {
x := s.getNext(s.head, 0)
x := s.getNext(s.getHead(), 0)
count := 0
for x != nil {
count++
Expand Down Expand Up @@ -460,7 +460,7 @@ func randomKey(rng *rand.Rand) []byte {

func TestBuilder(t *testing.T) {
N := 1 << 16
b := NewBuilder(32 << 20)
b := NewBuilder(32 << 10)
buf := make([]byte, 8)
for i := 0; i < N; i++ {
binary.BigEndian.PutUint64(buf, uint64(i))
Expand Down

0 comments on commit 33ca02f

Please sign in to comment.