Skip to content

Commit 2bcb751

Browse files
committed
Switched to std::map::emplace
edmDumpClassVersion was failing with ROOT failing to handle the std::make_pair call. The emplace method is more efficient anyway.
1 parent a27cac0 commit 2bcb751

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CondFormats/L1TObjects/interface/L1TriggerKey.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class L1TriggerKey {
4040

4141
/* Adds new record and type mapping to payload. If such exists, nothing happens */
4242
void add(const std::string& record, const std::string& type, const std::string& key) {
43-
m_recordToKey.insert(std::make_pair(record + "@" + type, key.empty() ? kNullKey : key));
43+
m_recordToKey.emplace(record + "@" + type, key.empty() ? kNullKey : key);
4444
}
4545

4646
void add(const RecordToKey& map) {
4747
for (RecordToKey::const_iterator itr = map.begin(); itr != map.end(); ++itr) {
48-
m_recordToKey.insert(std::make_pair(itr->first, itr->second.empty() ? kNullKey : itr->second));
48+
m_recordToKey.emplace(itr->first, itr->second.empty() ? kNullKey : itr->second);
4949
}
5050
}
5151

CondFormats/L1TObjects/interface/L1TriggerKeyExt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class L1TriggerKeyExt {
4040

4141
/* Adds new record and type mapping to payload. If such exists, nothing happens */
4242
void add(const std::string& record, const std::string& type, const std::string& key) {
43-
m_recordToKey.insert(std::make_pair(record + "@" + type, key.empty() ? kNullKey : key));
43+
m_recordToKey.emplace(record + "@" + type, key.empty() ? kNullKey : key);
4444
}
4545

4646
void add(const RecordToKey& map) {
4747
for (RecordToKey::const_iterator itr = map.begin(); itr != map.end(); ++itr) {
48-
m_recordToKey.insert(std::make_pair(itr->first, itr->second.empty() ? kNullKey : itr->second));
48+
m_recordToKey.emplace(itr->first, itr->second.empty() ? kNullKey : itr->second);
4949
}
5050
}
5151

0 commit comments

Comments
 (0)