Remove useless loop.

This commit is contained in:
Ahmed Yasin Koculu
2022-08-14 01:02:31 +02:00
parent e57582a8f9
commit 9b3aeb6ff2
2 changed files with 14 additions and 20 deletions
@@ -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()
+2 -2
View File
@@ -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>