diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2022-07-24 18:55:34 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-19 10:19:48 +0200 |
commit | f57a7b374e0f2d878cee1fa020af3323145b56a8 (patch) | |
tree | aa33a87ce241d492c076f8ec9bf0eb33eee1721e /include/tools | |
parent | e1ab83cbc47ff581dd826d757dd2997743f47d58 (diff) |
tools: use std::swap() in gen.hxx
Change-Id: I01df93aa825ab7a023cd4beb385b5fb41c2847ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137389
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/tools')
-rw-r--r-- | include/tools/gen.hxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index 8182676e0731..ea2c8de2c0e7 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -377,11 +377,7 @@ inline bool Range::Contains( tools::Long nIs ) const inline void Range::Justify() { if ( mnA > mnB ) - { - tools::Long nHelp = mnA; - mnA = mnB; - mnB = nHelp; - } + std::swap(mnA, mnB); } inline bool operator ==(Range const & r1, Range const & r2) @@ -444,11 +440,7 @@ inline bool Selection::Contains( tools::Long nIs ) const inline void Selection::Justify() { if ( mnA > mnB ) - { - tools::Long nHelp = mnA; - mnA = mnB; - mnB = nHelp; - } + std::swap(mnA, mnB); } inline bool operator ==(Selection const & s1, Selection const & s2) |