diff options
author | Neil <nyamatongwe@gmail.com> | 2018-10-09 10:47:35 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-10-09 10:47:35 +1100 |
commit | 00f3a3ba52bb03872758a300719622161b469faa (patch) | |
tree | 771c102fe38a932df32f09effa0d0cb8f9d7432a /src | |
parent | 2b3cbabf99fc8cf318ef5afd951c5c60618a4046 (diff) | |
download | scintilla-mirror-00f3a3ba52bb03872758a300719622161b469faa.tar.gz |
Backport: Improve performance of Editor::RangeText by avoding per-character checks.
Helps applications that call SCI_GETTARGETTEXT.
Backport of changeset 7109:29f0ca6d2d1b, but with const_cast to fix compile error.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index ba5601c5a..581e71918 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4155,9 +4155,7 @@ std::string Editor::RangeText(Sci::Position start, Sci::Position end) const { if (start < end) { const Sci::Position len = end - start; std::string ret(len, '\0'); - for (int i = 0; i < len; i++) { - ret[i] = pdoc->CharAt(start + i); - } + pdoc->GetCharRange(const_cast<char *>(ret.data()), start, len); return ret; } return std::string(); |