@@ -17,7 +17,7 @@ namespace Neo.Cryptography.MPTTrie
1717{
1818 partial class Trie
1919 {
20- private ReadOnlySpan < byte > Seek ( ref Node node , ReadOnlySpan < byte > path , out Node start )
20+ private ReadOnlySpan < byte > Seek ( ref Node node , ReadOnlySpan < byte > path , out Node ? start )
2121 {
2222 switch ( node . Type )
2323 {
@@ -57,7 +57,7 @@ private ReadOnlySpan<byte> Seek(ref Node node, ReadOnlySpan<byte> path, out Node
5757 }
5858 if ( path . StartsWith ( node . Key . Span ) )
5959 {
60- return new ( [ .. node . Key . Span , .. Seek ( ref node . _next , path [ node . Key . Length ..] , out start ) ] ) ;
60+ return new ( [ .. node . Key . Span , .. Seek ( ref node . _next ! , path [ node . Key . Length ..] , out start ) ] ) ;
6161 }
6262 if ( node . Key . Span . StartsWith ( path ) )
6363 {
@@ -71,7 +71,7 @@ private ReadOnlySpan<byte> Seek(ref Node node, ReadOnlySpan<byte> path, out Node
7171 return [ ] ;
7272 }
7373
74- public IEnumerable < ( ReadOnlyMemory < byte > Key , ReadOnlyMemory < byte > Value ) > Find ( ReadOnlySpan < byte > prefix , byte [ ] from = null )
74+ public IEnumerable < ( ReadOnlyMemory < byte > Key , ReadOnlyMemory < byte > Value ) > Find ( ReadOnlySpan < byte > prefix , byte [ ] ? from = null )
7575 {
7676 var path = ToNibbles ( prefix ) ;
7777 var offset = 0 ;
@@ -104,7 +104,7 @@ private ReadOnlySpan<byte> Seek(ref Node node, ReadOnlySpan<byte> path, out Node
104104 return Travers ( start , path , from , offset ) . Select ( p => ( new ReadOnlyMemory < byte > ( FromNibbles ( p . Key . Span ) ) , p . Value ) ) ;
105105 }
106106
107- private IEnumerable < ( ReadOnlyMemory < byte > Key , ReadOnlyMemory < byte > Value ) > Travers ( Node node , byte [ ] path , byte [ ] from , int offset )
107+ private IEnumerable < ( ReadOnlyMemory < byte > Key , ReadOnlyMemory < byte > Value ) > Travers ( Node ? node , byte [ ] path , byte [ ] from , int offset )
108108 {
109109 if ( node is null ) yield break ;
110110 if ( offset < 0 ) throw new InvalidOperationException ( "invalid offset" ) ;
0 commit comments