[core] Set bucket segments to initialize empty

This commit is contained in:
Bruno de Oliveira Abinader
2016-11-02 15:43:30 +02:00
parent 7534aa1594
commit 549929cefd
11 changed files with 54 additions and 13 deletions

View File

@@ -348,8 +348,7 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates) {
const std::size_t endVertex = vertices.size();
const std::size_t vertexCount = endVertex - startVertex;
if (segments.back().vertexLength + vertexCount > std::numeric_limits<uint16_t>::max()) {
// Move to a new group because the old one can't hold the geometry.
if (segments.empty() || segments.back().vertexLength + vertexCount > std::numeric_limits<uint16_t>::max()) {
segments.emplace_back(startVertex, triangles.size());
}