1
Fork 0
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:
Drew Stratford 2019-07-30 00:03:20 +12:00 committed by Andreas Kling
parent 7cf4706a85
commit 77cb83b629
2 changed files with 34 additions and 7 deletions

View file

@ -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);