diff options
author | Neil <nyamatongwe@gmail.com> | 2023-12-30 08:52:40 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2023-12-30 08:52:40 +1100 |
commit | 95413c5c3a74285e62e8e1d9a9ee1dcec4dba336 (patch) | |
tree | 0b12d8aabde7d7ed9d260e41cc232fba9358da65 /src/Selection.h | |
parent | afce8e03c9a083f4ffa86dc223ea7bdf81f520bb (diff) | |
download | scintilla-mirror-95413c5c3a74285e62e8e1d9a9ee1dcec4dba336.tar.gz |
Avoid unnecessary use of push_back and emplace_back by preserving ranges[0].
This allows more methods to be noexcept.
Diffstat (limited to 'src/Selection.h')
-rw-r--r-- | src/Selection.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Selection.h b/src/Selection.h index 03ce5083c..9f7d73c3c 100644 --- a/src/Selection.h +++ b/src/Selection.h @@ -166,7 +166,7 @@ public: // This is for when you want to move the caret in response to a // user direction command - for rectangular selections, use the range // that covers all selected text otherwise return the main selection. - SelectionSegment LimitsForRectangularElseMain() const; + SelectionSegment LimitsForRectangularElseMain() const noexcept; size_t Count() const noexcept; size_t Main() const noexcept; void SetMain(size_t r) noexcept; @@ -183,19 +183,19 @@ public: void MovePositions(bool insertion, Sci::Position startChange, Sci::Position length) noexcept; void TrimSelection(SelectionRange range) noexcept; void TrimOtherSelections(size_t r, SelectionRange range) noexcept; - void SetSelection(SelectionRange range); + void SetSelection(SelectionRange range) noexcept; void AddSelection(SelectionRange range); void AddSelectionWithoutTrim(SelectionRange range); - void DropSelection(size_t r); - void DropAdditionalRanges(); + void DropSelection(size_t r) noexcept; + void DropAdditionalRanges() noexcept; void TentativeSelection(SelectionRange range); void CommitTentative() noexcept; InSelection RangeType(size_t r) const noexcept; InSelection CharacterInSelection(Sci::Position posCharacter) const noexcept; InSelection InSelectionForEOL(Sci::Position pos) const noexcept; Sci::Position VirtualSpaceFor(Sci::Position pos) const noexcept; - void Clear(); - void RemoveDuplicates(); + void Clear() noexcept; + void RemoveDuplicates() noexcept; void RotateMain() noexcept; bool Tentative() const noexcept { return tentativeMain; } std::vector<SelectionRange> RangesCopy() const { |