mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-18 02:38:37 +00:00
Update sdb
This commit is contained in:
parent
21fb73d1f8
commit
011ebf7e03
@ -301,6 +301,10 @@ SDB_API HT_(Kv)* Ht_(find_kv)(HtName_(Ht)* ht, const KEY_TYPE key, bool* found)
|
||||
if (found) {
|
||||
*found = false;
|
||||
}
|
||||
if (!ht) {
|
||||
*found = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
HT_(Bucket) *bt = &ht->table[bucketfn (ht, key)];
|
||||
ut32 key_len = calcsize_key (ht, key);
|
||||
|
@ -368,13 +368,12 @@ SDB_API int sdb_add(Sdb* s, const char *key, const char *val, ut32 cas) {
|
||||
SDB_API bool sdb_exists(Sdb* s, const char *key) {
|
||||
ut32 pos;
|
||||
char ch;
|
||||
SdbKv *kv;
|
||||
bool found;
|
||||
int klen = strlen (key) + 1;
|
||||
if (!s) {
|
||||
return false;
|
||||
}
|
||||
kv = (SdbKv*)sdb_ht_find_kvp (s->ht, key, &found);
|
||||
SdbKv *kv = (SdbKv*)sdb_ht_find_kvp (s->ht, key, &found);
|
||||
if (found && kv) {
|
||||
char *v = sdbkv_value (kv);
|
||||
return v && *v;
|
||||
|
Loading…
Reference in New Issue
Block a user