radareorg / sdb

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

Fix value always equals to key issue #111

Closed ret2libc closed 8 years ago

ret2libc commented 8 years ago

I started adding some unit testing for SDB.... first test, and it looks like at the moment the whole thing should be completely broken :( :( Indeed key and value are always the same when inserted through ht_hash_insert.

What I would like to do is to make this HT implementation a little bit more generic, so that we can use that in r2 easily for other needs and not only for string-string pairs.

radare commented 8 years ago

Yes im not very happy with the new hastable but i wasnt either of the old. The whole ht needs another rewrite, i did some benchmarka about memory usage and performance that would be good to run while reworking this

ret2libc commented 8 years ago

I think we don't need a rewrite. It should work IMO, the implementation seems good and generic enough to be reused also somewhere else. Maybe there are just some small bugs that need to be fixed :) that's why i'm doing the tests. but, personally, i like it a lot :)