From 1a314d4b4c1703b05dac00f340b9839583681f3e Mon Sep 17 00:00:00 2001 From: wyy Date: Sat, 24 May 2014 13:44:55 +0800 Subject: [PATCH] use vector's reserve --- src/MPSegment.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MPSegment.hpp b/src/MPSegment.hpp index 3ae78b9..0746907 100644 --- a/src/MPSegment.hpp +++ b/src/MPSegment.hpp @@ -96,6 +96,7 @@ namespace CppJieba } vector SegmentChars; //calc DAG + SegmentChars.reserve(end - begin); if(!_calcDAG(begin, end, SegmentChars)) { LogError("_calcDAG failed.");