From a2931677c6e28aad5ddd56d82e5a8814746dc5fd Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 11 Jun 2020 10:08:29 +1000 Subject: Use noexcept where safe and maintainable. --- src/Selection.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/Selection.cxx') diff --git a/src/Selection.cxx b/src/Selection.cxx index 4a397b4aa..4274b190c 100644 --- a/src/Selection.cxx +++ b/src/Selection.cxx @@ -202,11 +202,11 @@ bool Selection::IsRectangular() const noexcept { return (selType == selRectangle) || (selType == selThin); } -Sci::Position Selection::MainCaret() const { +Sci::Position Selection::MainCaret() const noexcept { return ranges[mainRange].caret.Position(); } -Sci::Position Selection::MainAnchor() const { +Sci::Position Selection::MainAnchor() const noexcept { return ranges[mainRange].anchor.Position(); } @@ -214,7 +214,7 @@ SelectionRange &Selection::Rectangular() noexcept { return rangeRectangular; } -SelectionSegment Selection::Limits() const { +SelectionSegment Selection::Limits() const noexcept { if (ranges.empty()) { return SelectionSegment(); } else { @@ -248,23 +248,23 @@ void Selection::SetMain(size_t r) noexcept { mainRange = r; } -SelectionRange &Selection::Range(size_t r) { +SelectionRange &Selection::Range(size_t r) noexcept { return ranges[r]; } -const SelectionRange &Selection::Range(size_t r) const { +const SelectionRange &Selection::Range(size_t r) const noexcept { return ranges[r]; } -SelectionRange &Selection::RangeMain() { +SelectionRange &Selection::RangeMain() noexcept { return ranges[mainRange]; } -const SelectionRange &Selection::RangeMain() const { +const SelectionRange &Selection::RangeMain() const noexcept { return ranges[mainRange]; } -SelectionPosition Selection::Start() const { +SelectionPosition Selection::Start() const noexcept { if (IsRectangular()) { return rangeRectangular.Start(); } else { @@ -316,7 +316,7 @@ void Selection::MovePositions(bool insertion, Sci::Position startChange, Sci::Po } } -void Selection::TrimSelection(SelectionRange range) { +void Selection::TrimSelection(SelectionRange range) noexcept { for (size_t i=0; i ranges[i].Start().Position()) && (pos <= ranges[i].End().Position())) return i == mainRange ? 1 : 2; -- cgit v1.2.3