nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.12k stars 609 forks source link

Replace priority_queue::push with emplace. #472

Closed ttsugriy closed 1 year ago

ttsugriy commented 1 year ago

It's more concise and more importantly forwards args so that the pair can be constructed in-place, instead of being created at the call-site and moved into push. It's not a big deal as both values are primitive types, but still...

yurymalkov commented 1 year ago

Thanks!