mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 11:43:39 +00:00
update meta info when the key exists
This commit is contained in:
parent
27d60454a4
commit
fdfd8801c9
@ -228,15 +228,15 @@ R_API int r_meta_add(RAnal *a, int type, ut64 from, ut64 to, const char *str) {
|
||||
// to inconsistent DB, and pretty bad performance. We should
|
||||
// store this list in a different storage that doesnt have
|
||||
// those limits and it's O(1) instead of O(n)
|
||||
if (!exists) {
|
||||
//ut64 count;
|
||||
/* set type index */
|
||||
snprintf (key, sizeof (key)-1, "meta.0x%"PFMT64x, from);
|
||||
snprintf (val, sizeof (val)-1, "%c", type);
|
||||
sdb_array_add (DB, key, val, 0);
|
||||
/* set type index */
|
||||
//count = meta_type_add (a, type, from);
|
||||
snprintf (key, sizeof (key)-1, "meta.0x%"PFMT64x, from);
|
||||
if (exists) {
|
||||
char *value = sdb_get (DB, key, 0);
|
||||
int idx = sdb_array_indexof (DB, key, value, 0);
|
||||
sdb_array_delete (DB, key, idx, 0);
|
||||
}
|
||||
snprintf (val, sizeof (val)-1, "%c", type);
|
||||
sdb_array_add (DB, key, val, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user