antlarr / bard

Bard Music Manager - A database to manage your music, find duplicates and fix tags
GNU General Public License v3.0
63 stars 5 forks source link

use vector::emplace_back more effectively #3

Closed yumetodo closed 6 years ago

yumetodo commented 6 years ago

in https://github.com/antlarr/bard/commit/52bce48eca635f6210036366759ecd9c27ea0924 , std::vector<std::pair<int,std::vector<int>>> was introduced.

However, as far as I know, you can use vector::emplace_back more effectively.

--- current
+++ propose
- m_fingerprints.emplace_back(std::make_pair(songID, v));
+ m_fingerprints.emplace_back(songID, std::move(v));
antlarr commented 6 years ago

Thanks for the suggestion! I already applied the changes. I don't think it has a measurable improvement since it's only done once per song added to the fingerprints' vector, but any optimization is welcomed :)