diff options
author | Drew Stratford <drewstratford@outlook.com> | 2019-07-30 00:03:20 +1200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-29 19:34:31 +0200 |
commit | 77cb83b629c6db625de03611531efda6f1c01079 (patch) | |
tree | ce59ff4deb395b9b5371cb2b3643e56b9209eaba /Games/Minesweeper/Field.h | |
parent | 7cf4706a85a7f659adbeeae8bdea8dbcc360415b (diff) | |
download | serenity-77cb83b629c6db625de03611531efda6f1c01079.zip |
Minesweeper: make Field::flood_fill iterative
This change uses an iterative traversal to avoid stack overflows
in, the previously recursive, flood_fill.
Diffstat (limited to 'Games/Minesweeper/Field.h')
-rw-r--r-- | Games/Minesweeper/Field.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Games/Minesweeper/Field.h b/Games/Minesweeper/Field.h index eef12f936c..dec6a44512 100644 --- a/Games/Minesweeper/Field.h +++ b/Games/Minesweeper/Field.h @@ -67,6 +67,7 @@ private: const Square& square(int row, int column) const { return *m_squares[row * columns() + column]; } void flood_fill(Square&); + void flood_mark(Square&); template<typename Callback> void for_each_square(Callback); |