[core] Fix use after std::move detected by clang-tidy

Detected by the bot being setup at
https://github.com/mapbox/mapbox-gl-native/pull/15385.
This commit is contained in:
Thiago Marcos P. Santos
2019-08-19 11:44:33 +03:00
parent bf34fb0190
commit 6dfe0e60ca
3 changed files with 5 additions and 3 deletions

View File

@@ -366,7 +366,7 @@ void SymbolLayout::prepareSymbols(const GlyphMap& glyphMap, const GlyphPositions
Shaping shaping = applyShaping(*feature.formattedText, WritingModeType::Horizontal, SymbolAnchorType::Center, justification);
if (shaping) {
shapingForJustification = std::move(shaping);
if (shaping.lineCount == 1u) {
if (shapingForJustification.lineCount == 1u) {
shapedTextOrientations.singleLine = true;
break;
}

View File

@@ -98,8 +98,9 @@ void GlyphManager::processResponse(const Response& res, const FontStack& fontSta
}
for (auto& glyph : glyphs) {
entry.glyphs.erase(glyph.id);
entry.glyphs.emplace(glyph.id, makeMutable<Glyph>(std::move(glyph)));
auto id = glyph.id;
entry.glyphs.erase(id);
entry.glyphs.emplace(id, makeMutable<Glyph>(std::move(glyph)));
}
}

View File

@@ -74,6 +74,7 @@ std::vector<GeometryCollection> classifyRings(const GeometryCollection& rings) {
if (ccw == (area < 0 ? -1 : 1) && !polygon.empty()) {
polygons.emplace_back(std::move(polygon));
polygon = GeometryCollection();
}
polygon.emplace_back(ring);