diff options
author | Adrian Kummerlaender | 2016-12-11 17:42:00 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2016-12-11 17:42:00 +0100 |
commit | 575b204b4e39e06bbf4c74b5397c062196822040 (patch) | |
tree | 08d81d4b7b89db1fb24d73e2e442a1ce5d35eca0 /src | |
parent | 0263d6fa06efb78912fc51441162c230dd2003ce (diff) | |
download | termlife-575b204b4e39e06bbf4c74b5397c062196822040.tar termlife-575b204b4e39e06bbf4c74b5397c062196822040.tar.gz termlife-575b204b4e39e06bbf4c74b5397c062196822040.tar.bz2 termlife-575b204b4e39e06bbf4c74b5397c062196822040.tar.lz termlife-575b204b4e39e06bbf4c74b5397c062196822040.tar.xz termlife-575b204b4e39e06bbf4c74b5397c062196822040.tar.zst termlife-575b204b4e39e06bbf4c74b5397c062196822040.zip |
Use implicity tuple creation for update scheduling
Diffstat (limited to 'src')
-rw-r--r-- | src/world.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/world.h b/src/world.h index cabb4dd..61423c4 100644 --- a/src/world.h +++ b/src/world.h @@ -71,19 +71,19 @@ class World { std::stack<std::tuple<std::size_t, std::size_t, bool>> updates; this->area_.for_each([&](std::size_t i, std::size_t j) { - const std::uint8_t d = this->lifeDensityAt(i, j); + const std::uint8_t d{this->lifeDensityAt(i, j)}; if ( this->matrix_[j][i] ) { if ( d < 2 ) { - updates.push(std::make_tuple(i, j, false)); + updates.emplace(i, j, false); } else if ( d == 2 || d == 3 ) { - updates.push(std::make_tuple(i, j, true)); + updates.emplace(i, j, true); } else if ( d > 3 ) { - updates.push(std::make_tuple(i, j, false)); + updates.emplace(i, j, false); } } else { if ( d == 3 ) { - updates.push(std::make_tuple(i, j, true)); + updates.emplace(i, j, true); } } }); @@ -110,7 +110,7 @@ class World { private: const util::BoxTraverser area_; - std::size_t age_ = 0; + std::size_t age_{}; std::array<std::array<bool, WIDTH>, HEIGHT> matrix_; }; |