mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
use vector's reserve
This commit is contained in:
parent
7eb896529f
commit
1a314d4b4c
@ -96,6 +96,7 @@ namespace CppJieba
|
|||||||
}
|
}
|
||||||
vector<SegmentChar> SegmentChars;
|
vector<SegmentChar> SegmentChars;
|
||||||
//calc DAG
|
//calc DAG
|
||||||
|
SegmentChars.reserve(end - begin);
|
||||||
if(!_calcDAG(begin, end, SegmentChars))
|
if(!_calcDAG(begin, end, SegmentChars))
|
||||||
{
|
{
|
||||||
LogError("_calcDAG failed.");
|
LogError("_calcDAG failed.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user