From 657288e29880c0c8518452880715d57effdbeb89 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 3 Mar 2016 14:25:51 -0500 Subject: SERVER-19936 use StringMap in FTSSpec::_scoreStringV2 --- src/mongo/db/fts/fts_spec.cpp | 2 +- src/mongo/db/fts/fts_spec.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp index 9a5a4f78bc6..5663d338bc6 100644 --- a/src/mongo/db/fts/fts_spec.cpp +++ b/src/mongo/db/fts/fts_spec.cpp @@ -193,7 +193,7 @@ void FTSSpec::_scoreStringV2(FTSTokenizer* tokenizer, tokenizer->reset(raw.rawData(), FTSTokenizer::kFilterStopWords); while (tokenizer->moveNext()) { - string term = tokenizer->get().toString(); + StringData term = tokenizer->get(); ScoreHelperStruct& data = terms[term]; diff --git a/src/mongo/db/fts/fts_spec.h b/src/mongo/db/fts/fts_spec.h index d5cc0b46472..6356f3a58a8 100644 --- a/src/mongo/db/fts/fts_spec.h +++ b/src/mongo/db/fts/fts_spec.h @@ -40,6 +40,7 @@ #include "mongo/db/fts/stop_words.h" #include "mongo/db/fts/tokenizer.h" #include "mongo/platform/unordered_map.h" +#include "mongo/util/string_map.h" namespace mongo { @@ -58,7 +59,7 @@ struct ScoreHelperStruct { double count; double exp; }; -typedef unordered_map ScoreHelperMap; +typedef StringMap ScoreHelperMap; class FTSSpec { struct Tools { -- cgit v1.2.1