Use emplace_back instead of push_back (#2103)

Signed-off-by: dd-He <1843757857@qq.com>
This commit is contained in:
dd-He 2020-04-25 15:37:23 +08:00 committed by GitHub
parent 3c53ee2700
commit c33df2ee20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,7 +158,7 @@ IndexHNSW::Query(const DatasetPtr& dataset_ptr, const Config& config) {
ret = index_->searchKnn((float*)single_query, k, compare, blacklist);
while (ret.size() < k) {
ret.push_back(std::make_pair(-1, -1));
ret.emplace_back(std::make_pair(-1, -1));
}
std::vector<float> dist;
std::vector<int64_t> ids;