Explorar el Código

event_graph: Avoid loading keys for existence checks.

x hace 1 mes
padre
commit
5fbc73d652
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/event_graph/rln.rs

+ 1 - 1
src/event_graph/rln.rs

@@ -756,7 +756,7 @@ enum KeyKind {
 
 /// Build a key into sled if it doesn't already exist.
 fn ensure_key(sled_db: &sled::Db, key: &str, zkbin_bytes: &[u8], kind: KeyKind) -> Result<()> {
-    if sled_db.get(key)?.is_some() {
+    if sled_db.contains_key(key)? {
         return Ok(())
     }