We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2a8791b + b333309 commit 6c5e3dfCopy full SHA for 6c5e3df
src/LightningDB/LightningExtensions.cs
@@ -64,14 +64,12 @@ private static string mdb_strerror(int err)
64
[MethodImpl(MethodImplOptions.AggressiveInlining)]
65
public static IEnumerable<ValueTuple<MDBValue, MDBValue>> AsEnumerable(this LightningCursor cursor)
66
{
67
- do
+ while(cursor.Next() == MDBResultCode.Success)
68
69
var (resultCode, key, value) = cursor.GetCurrent();
70
- if (resultCode == MDBResultCode.Success)
71
- {
72
- yield return (key, value);
73
- }
74
- } while (cursor.Next() == MDBResultCode.Success);
+ resultCode.ThrowOnError();
+ yield return (key, value);
+ }
75
}
76
77
/// <summary>
0 commit comments