aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CellBuffer.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-04-28 09:37:22 +1000
committerNeil <nyamatongwe@gmail.com>2019-04-28 09:37:22 +1000
commit6a542f10f35a7f6182335250ac6fb25dbd230cac (patch)
tree8579d35a88cfbb6c8644fc938176c22058e85561 /src/CellBuffer.cxx
parent8be8298fd9fadccef7caa8cc4232f53a2f4b91fb (diff)
downloadscintilla-mirror-6a542f10f35a7f6182335250ac6fb25dbd230cac.tar.gz
Declare reading methods as noexcept where reasonable.
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r--src/CellBuffer.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index 1abff92dc..4d8e711ee 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -456,7 +456,7 @@ void UndoHistory::SetSavePoint() {
savePoint = currentAction;
}
-bool UndoHistory::IsSavePoint() const {
+bool UndoHistory::IsSavePoint() const noexcept {
return savePoint == currentAction;
}
@@ -480,7 +480,7 @@ int UndoHistory::TentativeSteps() {
return -1;
}
-bool UndoHistory::CanUndo() const {
+bool UndoHistory::CanUndo() const noexcept {
return (currentAction > 0) && (maxAction > 0);
}
@@ -505,7 +505,7 @@ void UndoHistory::CompletedUndoStep() {
currentAction--;
}
-bool UndoHistory::CanRedo() const {
+bool UndoHistory::CanRedo() const noexcept {
return maxAction > currentAction;
}
@@ -595,7 +595,7 @@ const char *CellBuffer::RangePointer(Sci::Position position, Sci::Position range
return substance.RangePointer(position, rangeLength);
}
-Sci::Position CellBuffer::GapPosition() const {
+Sci::Position CellBuffer::GapPosition() const noexcept {
return substance.GapPosition();
}
@@ -691,7 +691,7 @@ void CellBuffer::SetLineEndTypes(int utf8LineEnds_) {
}
}
-bool CellBuffer::ContainsLineEnd(const char *s, Sci::Position length) const {
+bool CellBuffer::ContainsLineEnd(const char *s, Sci::Position length) const noexcept {
unsigned char chBeforePrev = 0;
unsigned char chPrev = 0;
for (Sci::Position i = 0; i < length; i++) {
@@ -756,7 +756,7 @@ Sci::Line CellBuffer::LineFromPositionIndex(Sci::Position pos, int lineCharacter
return plv->LineFromPositionIndex(pos, lineCharacterIndex);
}
-bool CellBuffer::IsReadOnly() const {
+bool CellBuffer::IsReadOnly() const noexcept {
return readOnly;
}
@@ -764,11 +764,11 @@ void CellBuffer::SetReadOnly(bool set) {
readOnly = set;
}
-bool CellBuffer::IsLarge() const {
+bool CellBuffer::IsLarge() const noexcept {
return largeDocument;
}
-bool CellBuffer::HasStyles() const {
+bool CellBuffer::HasStyles() const noexcept {
return hasStyles;
}
@@ -776,7 +776,7 @@ void CellBuffer::SetSavePoint() {
uh.SetSavePoint();
}
-bool CellBuffer::IsSavePoint() const {
+bool CellBuffer::IsSavePoint() const noexcept {
return uh.IsSavePoint();
}
@@ -792,7 +792,7 @@ int CellBuffer::TentativeSteps() {
return uh.TentativeSteps();
}
-bool CellBuffer::TentativeActive() const {
+bool CellBuffer::TentativeActive() const noexcept {
return uh.TentativeActive();
}
@@ -806,7 +806,7 @@ void CellBuffer::RemoveLine(Sci::Line line) {
plv->RemoveLine(line);
}
-bool CellBuffer::UTF8LineEndOverlaps(Sci::Position position) const {
+bool CellBuffer::UTF8LineEndOverlaps(Sci::Position position) const noexcept {
const unsigned char bytes[] = {
static_cast<unsigned char>(substance.ValueAt(position-2)),
static_cast<unsigned char>(substance.ValueAt(position-1)),
@@ -1134,7 +1134,7 @@ bool CellBuffer::SetUndoCollection(bool collectUndo) {
return collectingUndo;
}
-bool CellBuffer::IsCollectingUndo() const {
+bool CellBuffer::IsCollectingUndo() const noexcept {
return collectingUndo;
}
@@ -1155,7 +1155,7 @@ void CellBuffer::DeleteUndoHistory() {
uh.DeleteUndoHistory();
}
-bool CellBuffer::CanUndo() const {
+bool CellBuffer::CanUndo() const noexcept {
return uh.CanUndo();
}
@@ -1181,7 +1181,7 @@ void CellBuffer::PerformUndoStep() {
uh.CompletedUndoStep();
}
-bool CellBuffer::CanRedo() const {
+bool CellBuffer::CanRedo() const noexcept {
return uh.CanRedo();
}