mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:37:36 +00:00
Minesweeper: make Field::flood_fill iterative
This change uses an iterative traversal to avoid stack overflows in, the previously recursive, flood_fill.
This commit is contained in:
parent
7cf4706a85
commit
77cb83b629
2 changed files with 34 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue