* prefer prefix increment operator unless logically necessary
  (it doesn't make any diff foro built-in type but good practice)
This commit is contained in:
artemp
2014-02-06 10:50:31 +00:00
parent a8fef83564
commit 2d3abf36b1
10 changed files with 16 additions and 18 deletions

View File

@@ -17,7 +17,7 @@ Tile::ID Tile::parent(const ID& id, int32_t z) {
assert(z < id.z);
ID pos(id);
while (pos.z > z) {
pos.z--;
--pos.z;
pos.x = floor(pos.x / 2);
pos.y = floor(pos.y / 2);
}
@@ -30,8 +30,8 @@ std::forward_list<Tile::ID> Tile::children(const ID& id, int32_t z) {
int32_t factor = pow(2, z - id.z);
std::forward_list<ID> children;
for (int32_t y = id.y * factor, y_max = (id.y + 1) * factor; y < y_max; y++) {
for (int32_t x = id.x * factor, x_max = (id.x + 1) * factor; x < x_max; x++) {
for (int32_t y = id.y * factor, y_max = (id.y + 1) * factor; y < y_max; ++y) {
for (int32_t x = id.x * factor, x_max = (id.x + 1) * factor; x < x_max; ++x) {
children.emplace_front(x, y, z);
}
}