Skip to content

Commit

Permalink
Absl (#54)
Browse files Browse the repository at this point in the history
* fix go mod

* Dev to Main (#39)

* try fixing race

* Revert "try fixing race"

This reverts commit 02ff901.

* using lock for set child and get child

* using locks only for set child and get child

* fix nil mu

* fix delete

* using locks to set attribute of node

* fix memdb tests

* tracking channel of child changes

* removed process lazy redundant

* fix nil check

* Fix get watch bug

* go fmt

* some minor fixes

* merge main

* fix go mod

* fix go mod

* fmt

* Dev to Main (#40)

* try fixing race

* Revert "try fixing race"

This reverts commit 02ff901.

* using lock for set child and get child

* using locks only for set child and get child

* fix nil mu

* fix delete

* using locks to set attribute of node

* fix memdb tests

* tracking channel of child changes

* removed process lazy redundant

* fix nil check

* Fix get watch bug

* go fmt

* some minor fixes

* merge main

* fix go mod

* fix go mod

* some minor fixes

* some minor fixes

* fmt

* Dev to main (#41)

* try fixing race

* Revert "try fixing race"

This reverts commit 02ff901.

* using lock for set child and get child

* using locks only for set child and get child

* fix nil mu

* fix delete

* using locks to set attribute of node

* fix memdb tests

* tracking channel of child changes

* removed process lazy redundant

* fix nil check

* Fix get watch bug

* go fmt

* some minor fixes

* merge main

* fix go mod

* fix go mod

* some minor fixes

* some minor fixes

* fmt

* some fixes

* Dev to Main (#42)

* try fixing race

* Revert "try fixing race"

This reverts commit 02ff901.

* using lock for set child and get child

* using locks only for set child and get child

* fix nil mu

* fix delete

* using locks to set attribute of node

* fix memdb tests

* tracking channel of child changes

* removed process lazy redundant

* fix nil check

* Fix get watch bug

* go fmt

* some minor fixes

* merge main

* fix go mod

* fix go mod

* some minor fixes

* some minor fixes

* fmt

* some fixes

* fix seek prefix watch

* SeekPrefix Watch Fix (#43)

* try fixing race

* Revert "try fixing race"

This reverts commit 02ff901.

* using lock for set child and get child

* using locks only for set child and get child

* fix nil mu

* fix delete

* using locks to set attribute of node

* fix memdb tests

* tracking channel of child changes

* removed process lazy redundant

* fix nil check

* Fix get watch bug

* go fmt

* some minor fixes

* merge main

* fix go mod

* fix go mod

* some minor fixes

* some minor fixes

* fmt

* some fixes

* fix seek prefix watch

* bug fix

* some fixes

* track mutation fixes

* fix iterator

* fix itertor
  • Loading branch information
absolutelightning authored May 30, 2024
1 parent ced0d6c commit e69b528
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (i *Iterator[T]) Next() ([]byte, T, bool) {
return getKey(leafCh.key), leafCh.value, true
case node4:
n4 := currentNode.(*Node4[T])
for itr := 3; itr >= 0; itr-- {
for itr := int(n4.getNumChildren() - 1); itr >= 0; itr-- {
nodeCh := n4.children[itr]
if nodeCh == nil {
continue
Expand All @@ -82,7 +82,7 @@ func (i *Iterator[T]) Next() ([]byte, T, bool) {
}
case node16:
n16 := currentNode.(*Node16[T])
for itr := 15; itr >= 0; itr-- {
for itr := int(n16.getNumChildren() - 1); itr >= 0; itr-- {
nodeCh := n16.children[itr]
if nodeCh == nil {
continue
Expand All @@ -95,7 +95,7 @@ func (i *Iterator[T]) Next() ([]byte, T, bool) {
}
case node48:
n48 := currentNode.(*Node48[T])
for itr := 0; itr < 256; itr++ {
for itr := 0; itr < int(n48.getNumChildren()-1); itr++ {
idx := n48.keys[itr]
if idx == 0 {
continue
Expand All @@ -112,7 +112,7 @@ func (i *Iterator[T]) Next() ([]byte, T, bool) {
}
case node256:
n256 := currentNode.(*Node256[T])
for itr := 255; itr >= 0; itr-- {
for itr := int(n256.getNumChildren() - 1); itr >= 0; itr-- {
nodeCh := n256.children[itr]
if nodeCh == nil {
continue
Expand Down
8 changes: 4 additions & 4 deletions path_iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (i *PathIterator[T]) Next() ([]byte, T, bool) {
continue
case node4:
n4 := currentNode.(*Node4[T])
for itr := 3; itr >= 0; itr-- {
for itr := int(n4.getNumChildren() - 1); itr >= 0; itr-- {
nodeCh := n4.children[itr]
if nodeCh == nil {
continue
Expand All @@ -56,7 +56,7 @@ func (i *PathIterator[T]) Next() ([]byte, T, bool) {
}
case node16:
n16 := currentNode.(*Node16[T])
for itr := 15; itr >= 0; itr-- {
for itr := int(n16.getNumChildren() - 1); itr >= 0; itr-- {
nodeCh := n16.children[itr]
if nodeCh == nil {
continue
Expand All @@ -69,7 +69,7 @@ func (i *PathIterator[T]) Next() ([]byte, T, bool) {
}
case node48:
n48 := currentNode.(*Node48[T])
for itr := 255; itr >= 0; itr-- {
for itr := int(n48.getNumChildren() - 1); itr >= 0; itr-- {
idx := n48.keys[itr]
if idx == 0 {
continue
Expand All @@ -86,7 +86,7 @@ func (i *PathIterator[T]) Next() ([]byte, T, bool) {
}
case node256:
n256 := currentNode.(*Node256[T])
for itr := 255; itr >= 0; itr-- {
for itr := int(n256.getNumChildren() - 1); itr >= 0; itr-- {
nodeCh := n256.children[itr]
if nodeCh == nil {
continue
Expand Down
8 changes: 4 additions & 4 deletions reverse_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (ri *ReverseIterator[T]) Previous() ([]byte, T, bool) {
return getKey(leafCh.key), leafCh.value, true
case node4:
n4 := currentNode.(*Node4[T])
for itr := 0; itr < 4; itr++ {
for itr := 0; itr < int(n4.getNumChildren()); itr++ {
nodeCh := n4.children[itr]
if nodeCh == nil {
continue
Expand All @@ -229,7 +229,7 @@ func (ri *ReverseIterator[T]) Previous() ([]byte, T, bool) {
}
case node16:
n16 := currentNode.(*Node16[T])
for itr := 0; itr < 16; itr++ {
for itr := 0; itr < int(n16.getNumChildren()); itr++ {
nodeCh := n16.children[itr]
if nodeCh == nil {
continue
Expand All @@ -242,7 +242,7 @@ func (ri *ReverseIterator[T]) Previous() ([]byte, T, bool) {
}
case node48:
n48 := currentNode.(*Node48[T])
for itr := 0; itr < 256; itr++ {
for itr := 0; itr < int(n48.getNumChildren()); itr++ {
idx := n48.keys[itr]
if idx == 0 {
continue
Expand All @@ -259,7 +259,7 @@ func (ri *ReverseIterator[T]) Previous() ([]byte, T, bool) {
}
case node256:
n256 := currentNode.(*Node256[T])
for itr := 0; itr < 256; itr++ {
for itr := 0; itr < int(n256.getNumChildren()); itr++ {
nodeCh := n256.children[itr]
if nodeCh == nil {
continue
Expand Down

0 comments on commit e69b528

Please sign in to comment.