From 575b204b4e39e06bbf4c74b5397c062196822040 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 11 Dec 2016 17:42:00 +0100 Subject: Use implicity tuple creation for update scheduling --- src/world.h | 12 ++++++------ 1 file 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> 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, HEIGHT> matrix_; }; -- cgit v1.2.3