radareorg / sdb

Simple and fast string based key-value database with support for arrays and json
https://www.radare.org/
MIT License
218 stars 62 forks source link

sdb: add API to return (sorted) list filtered #166

Closed ret2libc closed 5 years ago

ret2libc commented 5 years ago

this will be useful in r2 cmd_type where a lot of times we iterate over all sdb just to get some keys that have a given prefix... https://github.com/radare/radare2/blob/master/libr/core/cmd_type.c#L335 https://github.com/radare/radare2/blob/master/libr/core/cmd_type.c#L320 etc. At the same time, we can return a sorted list, which will make the tests stable (because ht does not have ordering).