roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.06k stars 211 forks source link

Implement prevof() for List and Hashmap #619

Closed gavv closed 7 months ago

gavv commented 11 months ago

core::List and core::Hashmap implement intrusive doubly-linked list and hashtable.

Both of them has nextof() method that returns element next to given one, or NULL if it's the last element.

It would be handy to also add prevof() method, returning element previous to given one, or NULL for the first element.

Uni tests should be expanded to cover new methods.

narayanatanniru commented 11 months ago

Hello @gavv! I'd like to work on this issue. Please let me know if it's still open. P.S: Also, if possible please let me know, whom should I be in touch with to be able to contribute. Thanks a lot!

gavv commented 11 months ago

Thanks, yes, it's still open. If you have any questions, feel free to ask here or in matrix chat (see readme)

narayanatanniru commented 11 months ago

Alright, I'll get started!

narayanatanniru commented 11 months ago

Hey @gavv, Have implemented the prevof() for core::List. However I've observed that there is no implementation of nextof() for core::Hashmap. Maybe I'm not looking in the right place. I could use some pointers in writing the Unit Test cases for the same 🙃.

gavv commented 11 months ago

Hashmap has nextof too: https://github.com/roc-streaming/roc-toolkit/blob/3f4d3edb3966a6904b2f1a9cd5c7b4ef67283d55/src/internal_modules/roc_core/hashmap.h#L197

gavv commented 11 months ago

Just realized, probably you're using master branch instead of develop.

gavv commented 9 months ago

I needed List::prevof() recently, so I implemented it: 75999d851551ccf3229932aaf2a9f38b765edf70

Hashmap::prevof() is still lacking.

@narayanatanniru do you still have plans on this issue?

gavv commented 7 months ago

Hashmap::prevof() is not implemented too: ecce568ed57874549ecb83f2c73d5119651e44ec