diff options
author | Neil <nyamatongwe@gmail.com> | 2023-01-12 22:38:36 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2023-01-12 22:38:36 +1100 |
commit | 0f22138771c1374b9094973ebbac1e780c6bba47 (patch) | |
tree | 7352ac318d8fa907fa2e3d0235ceadd8e1ec8504 | |
parent | 28d0a77bff56407bdfbe3a37e6d5316d88e9138d (diff) | |
download | scintilla-mirror-0f22138771c1374b9094973ebbac1e780c6bba47.tar.gz |
Shorten code with std::swap.
-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 89f248dbe..fd0f8b8c4 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -801,9 +801,7 @@ void Editor::MultipleSelectAdd(AddNumber addNumber) { bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) const noexcept { if (vs.ProtectionActive()) { if (start > end) { - const Sci::Position t = start; - start = end; - end = t; + std::swap(start, end); } for (Sci::Position pos = start; pos < end; pos++) { if (vs.styles[pdoc->StyleIndexAt(pos)].IsProtected()) |