Hacker News new | ask | show | jobs
by quinnftw 3586 days ago
Or if you want a non-obfuscated version

https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04...

2 comments

Use splice to move items to the front of the list without copying in the find method.
ah, now I remember why I had carried on with the linked list from the old c++ codebase

https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04...

the key refresh in std::list required a copy of the std::pair, where as I wished to keep it as an unlink / relink