From 7cb8abba8c1b026f3b9450f3e163e09357b49906 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 9 Oct 2018 10:47:35 +1100 Subject: Improve performance of Editor::RangeText by avoding per-character checks. Helps applications that call SCI_GETTARGETTEXT. --- src/Editor.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3