aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UndoHistory.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2024-02-01 16:37:24 +1100
committerNeil <nyamatongwe@gmail.com>2024-02-01 16:37:24 +1100
commit2d69e7321020afde6fb8c45943c5d59781461e6b (patch)
tree4f19e0c15f4d139a9df6f68f429d32a5e876b8ff /src/UndoHistory.cxx
parentfa3f060e142243c7848284f16561d4af9f9ee935 (diff)
downloadscintilla-mirror-2d69e7321020afde6fb8c45943c5d59781461e6b.tar.gz
Prefer member initializers. Simplify logic.
Diffstat (limited to 'src/UndoHistory.cxx')
-rw-r--r--src/UndoHistory.cxx10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/UndoHistory.cxx b/src/UndoHistory.cxx
index bc1a4d36a..88e931ea9 100644
--- a/src/UndoHistory.cxx
+++ b/src/UndoHistory.cxx
@@ -101,15 +101,8 @@ const char *ScrapStack::TextAt(size_t position) const noexcept {
// Sequences that look like typing or deletion are coalesced into a single user operation.
UndoHistory::UndoHistory() {
-
actions.resize(3);
- maxAction = 0;
- currentAction = 0;
- undoSequenceDepth = 0;
- savePoint = 0;
- tentativePoint = -1;
scraps = std::make_unique<ScrapStack>();
-
actions[currentAction].Create(ActionType::start);
}
@@ -287,8 +280,7 @@ int UndoHistory::TentativeSteps() noexcept {
currentAction--;
if (tentativePoint >= 0)
return currentAction - tentativePoint;
- else
- return -1;
+ return -1;
}
bool UndoHistory::CanUndo() const noexcept {