Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6629)

Unified Diff: chrome/renderer/safe_browsing/scorer.cc

Issue 2829163004: Remove uses of base::hash_map from //chrome (Closed)
Patch Set: Downloads back Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/safe_browsing/scorer.cc
diff --git a/chrome/renderer/safe_browsing/scorer.cc b/chrome/renderer/safe_browsing/scorer.cc
index fc03badcc6f5844f6a4f5d75f3d90d5bdded4130..7c25f3b954a6c5be64586f4dc6de42bd906d3896 100644
--- a/chrome/renderer/safe_browsing/scorer.cc
+++ b/chrome/renderer/safe_browsing/scorer.cc
@@ -7,6 +7,7 @@
#include <math.h>
#include <memory>
+#include <unordered_map>
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -114,11 +115,11 @@ size_t Scorer::shingle_size() const {
double Scorer::ComputeRuleScore(const ClientSideModel::Rule& rule,
const FeatureMap& features) const {
- const base::hash_map<std::string, double>& feature_map = features.features();
+ const std::unordered_map<std::string, double>& feature_map =
+ features.features();
double rule_score = 1.0;
for (int i = 0; i < rule.feature_size(); ++i) {
- base::hash_map<std::string, double>::const_iterator it = feature_map.find(
- model_.hashes(rule.feature(i)));
+ const auto it = feature_map.find(model_.hashes(rule.feature(i)));
if (it == feature_map.end() || it->second == 0.0) {
// If the feature of the rule does not exist in the given feature map the
// feature weight is considered to be zero. If the feature weight is zero
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc ('k') | chrome/renderer/tts_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698