Merge branch 'development'

This commit is contained in:
Emir Pasic 2022-04-12 05:09:42 +02:00
commit 3bca87dfc4

View File

@ -56,13 +56,11 @@ func (iterator *Iterator) Next() bool {
}
goto between
}
if iterator.node.Parent != nil {
for iterator.node.Parent != nil {
node := iterator.node
for iterator.node.Parent != nil {
iterator.node = iterator.node.Parent
if iterator.tree.Comparator(node.Key, iterator.node.Key) <= 0 {
goto between
}
iterator.node = iterator.node.Parent
if node == iterator.node.Left {
goto between
}
}
@ -98,13 +96,11 @@ func (iterator *Iterator) Prev() bool {
}
goto between
}
if iterator.node.Parent != nil {
for iterator.node.Parent != nil {
node := iterator.node
for iterator.node.Parent != nil {
iterator.node = iterator.node.Parent
if iterator.tree.Comparator(node.Key, iterator.node.Key) >= 0 {
goto between
}
iterator.node = iterator.node.Parent
if node == iterator.node.Right {
goto between
}
}