diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-02-29 09:11:59 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-02-29 09:11:59 +1100 |
| commit | 190e7c5a66f6e3bfa633d0a4705f96312d385013 (patch) | |
| tree | e18d80e5327e8dd50c0e942fab9abca4e378b907 /src/Editor.cxx | |
| parent | 69f9cd35dfa530c657c1853a471a4bc45db1818f (diff) | |
| download | scintilla-mirror-190e7c5a66f6e3bfa633d0a4705f96312d385013.tar.gz | |
Backport: Add const and noexcept where they make sense.
Backport of changeset 7991:d7d83db0457a.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 5bbc55969..fb3aae6a1 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -561,7 +561,7 @@ Sci::Position Editor::CurrentPosition() const { return sel.MainCaret(); } -bool Editor::SelectionEmpty() const { +bool Editor::SelectionEmpty() const noexcept { return sel.Empty(); } @@ -785,7 +785,7 @@ void Editor::MultipleSelectAdd(AddNumber addNumber) { } } -bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) const { +bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) const noexcept { if (vs.ProtectionActive()) { if (start > end) { const Sci::Position t = start; @@ -800,7 +800,7 @@ bool Editor::RangeContainsProtected(Sci::Position start, Sci::Position end) cons return false; } -bool Editor::SelectionContainsProtected() { +bool Editor::SelectionContainsProtected() const { for (size_t r=0; r<sel.Count(); r++) { if (RangeContainsProtected(sel.Range(r).Start().Position(), sel.Range(r).End().Position())) { @@ -1920,7 +1920,7 @@ void Editor::InsertCharacter(const char *s, unsigned int len, CharacterSource ch } // Order selections by position in document. std::sort(selPtrs.begin(), selPtrs.end(), - [](const SelectionRange *a, const SelectionRange *b) {return *a < *b;}); + [](const SelectionRange *a, const SelectionRange *b) noexcept {return *a < *b;}); // Loop in reverse to avoid disturbing positions of selections yet to be processed. for (std::vector<SelectionRange *>::reverse_iterator rit = selPtrs.rbegin(); |
