Skip to content

Commit

Permalink
reorder fields to save 16 bytes per tile
Browse files Browse the repository at this point in the history
closes #62
  • Loading branch information
mourner committed Jun 22, 2018
1 parent 395281f commit 3ecd9d1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/mapbox/geojsonvt/tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ namespace detail {

class InternalTile {
public:
const uint16_t extent;
bool is_solid = false;
const uint8_t z;
const uint32_t x;
const uint32_t y;

const double z2;
const double tolerance;
const double sq_tolerance;

vt_features source_features;
bool is_solid = false;
mapbox::geometry::box<double> bbox = { { 2, 1 }, { -1, 0 } };

Tile tile;
Expand All @@ -34,11 +39,11 @@ class InternalTile {
const uint16_t extent_,
const uint16_t buffer,
const double tolerance_)
: z(z_),
: extent(extent_),
z(z_),
x(x_),
y(y_),
z2(std::pow(2, z)),
extent(extent_),
tolerance(tolerance_),
sq_tolerance(tolerance_ * tolerance_) {

Expand All @@ -64,11 +69,6 @@ class InternalTile {
}

private:
const double z2;
const uint16_t extent;
const double tolerance;
const double sq_tolerance;

bool isSolid(const uint16_t buffer) {
if (tile.features.size() != 1)
return false;
Expand Down

0 comments on commit 3ecd9d1

Please sign in to comment.