diff options
author | Neil <nyamatongwe@gmail.com> | 2014-09-13 18:53:11 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-09-13 18:53:11 +1000 |
commit | ecfc945378e1fdcd0d4dec800ff6f27ae78825ea (patch) | |
tree | 4755e1aa05be35adeecc97c0b30be76d2d437ff7 | |
parent | ee3c823a943b83d3a400fb232404749ce52b70b9 (diff) | |
download | scintilla-mirror-ecfc945378e1fdcd0d4dec800ff6f27ae78825ea.tar.gz |
Avoid extra NUL in strings and unnecessary allocations.
-rw-r--r-- | src/RESearch.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/RESearch.cxx b/src/RESearch.cxx index 138469f0a..dbf1423e7 100644 --- a/src/RESearch.cxx +++ b/src/RESearch.cxx @@ -276,10 +276,9 @@ void RESearch::GrabMatches(CharacterIndexer &ci) { for (unsigned int i = 0; i < MAXTAG; i++) { if ((bopat[i] != NOTFOUND) && (eopat[i] != NOTFOUND)) { unsigned int len = eopat[i] - bopat[i]; - pat[i] = std::string(len+1, '\0'); + pat[i].resize(len); for (unsigned int j = 0; j < len; j++) pat[i][j] = ci.CharAt(bopat[i] + j); - pat[i][len] = '\0'; } } } |