diff options
author | Mathias Stearn <mathias@10gen.com> | 2016-03-03 14:25:51 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2016-03-11 08:55:40 -0500 |
commit | 657288e29880c0c8518452880715d57effdbeb89 (patch) | |
tree | b94056dc59b20b3b7bd3cd31feacbadbb515cdd6 /src/mongo/db/fts | |
parent | 4b10e50494175df2b1ed8fc4f8e7f8c6ca6f06d5 (diff) | |
download | mongo-657288e29880c0c8518452880715d57effdbeb89.tar.gz |
SERVER-19936 use StringMap in FTSSpec::_scoreStringV2
Diffstat (limited to 'src/mongo/db/fts')
-rw-r--r-- | src/mongo/db/fts/fts_spec.cpp | 2 | ||||
-rw-r--r-- | 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<std::string, ScoreHelperStruct> ScoreHelperMap; +typedef StringMap<ScoreHelperStruct> ScoreHelperMap; class FTSSpec { struct Tools { |