summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Schwarzer <[email protected]>2016-05-22 11:34:10 +0200
committerFrederik Schwarzer <[email protected]>2016-05-22 11:34:10 +0200
commita1437a52ceb706d6f993190d99b8e6faf2753e04 (patch)
tree93723a1fb665ace23f5a6839b4f7a8447270b8ce
parenta23621487a4074f8285dd16124f95feeec308ff4 (diff)
More straight-forward clearing of a list.
-rw-r--r--src/board.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/board.cpp b/src/board.cpp
index c756ed6..6df52c4 100644
--- a/src/board.cpp
+++ b/src/board.cpp
@@ -1408,8 +1408,8 @@ void Board::madeMove(TilePos const & tilePos1, TilePos const & tilePos2, Slide s
move = std::make_unique<Move>(tilePos1, tilePos2, field(tilePos1), field(tilePos2), slide);
}
m_undo.push_back(std::move(move));
- while (m_redo.size() != 0) {
- m_redo.pop_front();
+ if (!m_redo.empty()) {
+ m_redo.clear();
}
emit changed();
}