2 ms·
Or if you want a non-obfuscated version https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04b9f https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3
by quinnftw 10y ago
Or if you want a non-obfuscated version
https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04b9f https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04...
- mohaps 10y agoah, now I remember why I had carried on with the linked list from the old c++ codebase https://gist.github.com/Quinny/09e34afb1d187e43dea2f3c3b0c04b9f#file-lru_cache-h-L28 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
- en4bz 10y agoUse splice to move items to the front of the list without copying in the find method.