diff --git a/power/VcdReader.cc b/power/VcdReader.cc index 6655686b..24c539dd 100644 --- a/power/VcdReader.cc +++ b/power/VcdReader.cc @@ -25,7 +25,7 @@ #include "VcdReader.hh" #include -#include +#include #include "VcdParse.hh" #include "Debug.hh" @@ -43,7 +43,7 @@ using std::abs; using std::min; using std::to_string; using std::vector; -using std::map; +using std::unordered_map; // Transition count and high time for duty cycle for a group of pins // for one bit of vcd ID. @@ -116,7 +116,7 @@ VcdCount::highTime(VcdTime time_max) const // VcdCount[bit] typedef vector VcdCounts; // ID -> VcdCount[bit] -typedef map VcdIdCountsMap; +typedef unordered_map VcdIdCountsMap; class VcdCountReader : public VcdReader { @@ -290,7 +290,7 @@ VcdCountReader::varAppendValue(const string &id, VcdTime time, char value) { - auto itr = vcd_count_map_.find(id); + const auto &itr = vcd_count_map_.find(id); if (itr != vcd_count_map_.end()) { VcdCounts &vcd_counts = itr->second; if (debug_->check("read_vcd_activities", 3)) { @@ -316,7 +316,7 @@ VcdCountReader::varAppendBusValue(const string &id, VcdTime time, int64_t bus_value) { - auto itr = vcd_count_map_.find(id); + const auto &itr = vcd_count_map_.find(id); if (itr != vcd_count_map_.end()) { VcdCounts &vcd_counts = itr->second; for (size_t bit_idx = 0; bit_idx < vcd_counts.size(); bit_idx++) {