use map in extract to fix a unordered bug in different environment , by the way, it improves 1/6 speed

This commit is contained in:
wyy 2014-03-11 10:43:06 +08:00
parent 90d2280002
commit e3b58d6ddc

View File

@ -112,13 +112,13 @@ namespace CppJieba
}
}
unordered_map<string, double> wordmap;
map<string, double> wordmap;
for(uint i = 0; i < words.size(); i ++)
{
wordmap[ words[i] ] += 1.0;
}
for(unordered_map<string, double>::iterator itr = wordmap.begin(); itr != wordmap.end(); )
for(map<string, double>::iterator itr = wordmap.begin(); itr != wordmap.end(); )
{
if(_blackSet.end() != _blackSet.find(itr->first))
{