File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
contract_samples/rust/sdk/src Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ where
264264 unsafe {
265265 let cache = & mut * self . cache . get ( ) ;
266266 if !cache. contains_key ( & storage_key) {
267- if kv_get :: < V > ( & storage_key) . is_some ( ) {
267+ if kv_exists ( & storage_key) {
268268 cache. insert ( storage_key. clone ( ) , LazyCell :: with_prefix ( storage_key. clone ( ) ) ) ;
269269 } else {
270270 return None ;
@@ -280,7 +280,7 @@ where
280280 unsafe {
281281 let cache = & mut * self . cache . get ( ) ;
282282 if !cache. contains_key ( & storage_key) {
283- if kv_get :: < V > ( & storage_key) . is_some ( ) {
283+ if kv_exists ( & storage_key) {
284284 cache. insert ( storage_key. clone ( ) , LazyCell :: with_prefix ( storage_key. clone ( ) ) ) ;
285285 } else {
286286 return None ;
Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ pub fn kv_exists(key: impl Payload) -> bool {
134134 }
135135 #[ cfg( not( any( test, feature = "testing" ) ) ) ]
136136 unsafe {
137- let ptr = import_kv_exists ( key_bytes. as_ptr ( ) , key_bytes. len ( ) ) ;
138- * ( ptr as * const i32 ) == 1
137+ let result = import_kv_exists ( key_bytes. as_ptr ( ) , key_bytes. len ( ) ) ;
138+ result == 1
139139 }
140140}
141141
You can’t perform that action at this time.
0 commit comments