]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
report_manager: use unordered externalIdMap
authorJustin Viiret <justin.viiret@intel.com>
Mon, 24 Apr 2017 04:40:47 +0000 (14:40 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 30 May 2017 03:58:32 +0000 (13:58 +1000)
src/util/report_manager.cpp
src/util/report_manager.h

index 9c72da07dc4e22ae9b07a1e8b70fcebb3eb7179b..6f6bd0e8af64a90aaa701f16bed55271dd9e1ef9 100644 (file)
@@ -174,8 +174,9 @@ u32 ReportManager::getDkey(const Report &r) const {
 
 void ReportManager::registerExtReport(ReportID id,
                                       const external_report_info &ext) {
-    if (contains(externalIdMap, id)) {
-        const external_report_info &eri = externalIdMap.at(id);
+    auto it = externalIdMap.find(id);
+    if (it != externalIdMap.end()) {
+        const external_report_info &eri = it->second;
         if (eri.highlander != ext.highlander) {
             /* we have a problem */
             ostringstream out;
index f76aff22c29845410d072a6d26ec7aacc2c57461..3fcad3303fdd850096f174a5a4a46b16b4c5f731 100644 (file)
@@ -38,6 +38,7 @@
 #include "util/compile_error.h"
 #include "util/noncopyable.h"
 #include "util/report.h"
+#include "util/ue2_containers.h"
 
 #include <map>
 #include <set>
@@ -140,7 +141,7 @@ private:
 
     /** \brief Mapping from external match ids to information about that
      * id. */
-    std::map<ReportID, external_report_info> externalIdMap;
+    unordered_map<ReportID, external_report_info> externalIdMap;
 
     /** \brief Mapping from expression index to exhaustion key. */
     std::map<s64a, u32> toExhaustibleKeyMap;