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 | 7cb8abba8c1b026f3b9450f3e163e09357b49906 (patch) | |
tree | 82a2f06ffb2bbfd6d49fae6b0f2a330737addaaa | |
parent | b2da7da8ece3db03cc3d87b828a8b1b39b880454 (diff) | |
download | scintilla-mirror-7cb8abba8c1b026f3b9450f3e163e09357b49906.tar.gz |
Improve performance of Editor::RangeText by avoding per-character checks.
Helps applications that call SCI_GETTARGETTEXT.
-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 862acf696..ad26a62d8 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4158,9 +4158,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(ret.data(), start, len); return ret; } return std::string(); |