use vector's reserve

This commit is contained in:
wyy 2014-05-24 13:44:55 +08:00
parent 7eb896529f
commit 1a314d4b4c

View File

@ -96,6 +96,7 @@ namespace CppJieba
}
vector<SegmentChar> SegmentChars;
//calc DAG
SegmentChars.reserve(end - begin);
if(!_calcDAG(begin, end, SegmentChars))
{
LogError("_calcDAG failed.");