mirror of
https://github.com/ZoneTree/ZoneTree.git
synced 2026-10-28 12:47:01 +08:00
Remove useless loop.
This commit is contained in:
@@ -36,15 +36,12 @@ public class BTreeSeekableIterator<TKey, TValue>
|
||||
if (CurrentNode.Next())
|
||||
return true;
|
||||
|
||||
while (true)
|
||||
{
|
||||
var nextNode = CurrentNode.GetNextNodeIterator();
|
||||
if (nextNode == null)
|
||||
return false;
|
||||
nextNode.SeekBegin();
|
||||
CurrentNode = nextNode;
|
||||
return nextNode.HasCurrent;
|
||||
}
|
||||
var nextNode = CurrentNode.GetNextNodeIterator();
|
||||
if (nextNode == null)
|
||||
return false;
|
||||
nextNode.SeekBegin();
|
||||
CurrentNode = nextNode;
|
||||
return nextNode.HasCurrent;
|
||||
}
|
||||
|
||||
public bool Prev()
|
||||
@@ -52,15 +49,12 @@ public class BTreeSeekableIterator<TKey, TValue>
|
||||
if (CurrentNode.Previous())
|
||||
return true;
|
||||
|
||||
while (true)
|
||||
{
|
||||
var prevNode = CurrentNode.GetPreviousNodeIterator();
|
||||
if (prevNode == null)
|
||||
return false;
|
||||
CurrentNode = prevNode;
|
||||
prevNode.SeekEnd();
|
||||
return prevNode.HasCurrent;
|
||||
}
|
||||
var prevNode = CurrentNode.GetPreviousNodeIterator();
|
||||
if (prevNode == null)
|
||||
return false;
|
||||
CurrentNode = prevNode;
|
||||
prevNode.SeekEnd();
|
||||
return prevNode.HasCurrent;
|
||||
}
|
||||
|
||||
public bool SeekBegin()
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<Authors>Ahmed Yasin Koculu</Authors>
|
||||
<PackageId>ZoneTree</PackageId>
|
||||
<Title>ZoneTree</Title>
|
||||
<ProductVersion>1.2.6.0</ProductVersion>
|
||||
<Version>1.2.6.0</Version>
|
||||
<ProductVersion>1.2.7.0</ProductVersion>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Authors>Ahmed Yasin Koculu</Authors>
|
||||
<AssemblyTitle>ZoneTree</AssemblyTitle>
|
||||
<Description>ZoneTree is a persistent, high-performance key-value database for .NET. It can operate in memory or on a disk. (Optimized for SSDs)</Description>
|
||||
|
||||
Reference in New Issue
Block a user