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 | 3a7500e96cff3e2f308fc766765057ed6056a7b5 (patch) | |
tree | 472b2503c3c3f61adcf5dee4986cd7bdd97bbd54 | |
parent | 1fb6014195ea0576e8f3146d722d5587ff3ab774 (diff) | |
download | scintilla-mirror-3a7500e96cff3e2f308fc766765057ed6056a7b5.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'; } } } |