remove std::make_pair
make_pair is an old C++98 function that can be replaced by modern shorter constructs. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -78,7 +78,7 @@ static void
|
||||
CollectGroupCounts(TagCountMap &map, const Tag &tag,
|
||||
const char *value) noexcept
|
||||
{
|
||||
auto &s = map.insert(std::make_pair(value, SearchStats())).first->second;
|
||||
auto &s = map.emplace(value, SearchStats()).first->second;
|
||||
++s.n_songs;
|
||||
if (!tag.duration.IsNegative())
|
||||
s.total_duration += tag.duration;
|
||||
|
||||
@@ -109,8 +109,7 @@ static std::map<int, WatchDirectory *> inotify_directories;
|
||||
static void
|
||||
tree_add_watch_directory(WatchDirectory *directory)
|
||||
{
|
||||
inotify_directories.insert(std::make_pair(directory->descriptor,
|
||||
directory));
|
||||
inotify_directories.emplace(directory->descriptor, directory);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user