@@ -309,7 +309,7 @@ public static Slice ToNativeString(string value, bool nullTerminated)
309309 {
310310 result = Slice . DefaultEncoding . GetBytes ( value ) ;
311311 }
312- return new Slice ( result , 0 , result . Length ) ;
312+ return Slice . CreateUnsafe ( result , 0 , result . Length ) ;
313313 }
314314
315315
@@ -696,7 +696,7 @@ public static FdbError FutureGetValue(FutureHandle future, out bool valuePresent
696696 {
697697 var bytes = new byte [ valueLength ] ;
698698 Marshal . Copy ( new IntPtr ( ptr ) , bytes , 0 , valueLength ) ;
699- value = new Slice ( bytes , 0 , valueLength ) ;
699+ value = Slice . CreateUnsafe ( bytes , 0 , valueLength ) ;
700700 }
701701 else
702702 {
@@ -785,8 +785,8 @@ public static FdbError FutureGetKeyValueArray(FutureHandle future, out KeyValueP
785785 Marshal . Copy ( kvp [ i ] . Value , page , p + kl , vl ) ;
786786
787787 result [ i ] = new KeyValuePair < Slice , Slice > (
788- new Slice ( page , p , kl ) ,
789- new Slice ( page , p + kl , vl )
788+ page . AsSlice ( p , kl ) ,
789+ page . AsSlice ( p + kl , vl )
790790 ) ;
791791
792792 p += kl + vl ;
0 commit comments