From 0f22138771c1374b9094973ebbac1e780c6bba47 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 12 Jan 2023 22:38:36 +1100 Subject: Shorten code with std::swap. --- 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 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()) -- cgit v1.2.3