use unordered map, don't make copies (auto usage!) and swap maps

This commit is contained in:
Konstantin Käfer
2014-05-26 18:40:47 +02:00
parent 65bffccfd9
commit 1b58fb30a3
7 changed files with 36 additions and 35 deletions

View File

@@ -7,8 +7,8 @@ using namespace llmr;
void Painter::renderRaster(RasterBucket& bucket, const std::string& layer_name, const Tile::ID& /*id*/) {
if (pass == Translucent) return;
auto raster_properties = map.getStyle().computed.rasters;
auto raster_properties_it = raster_properties.find(layer_name);
const std::unordered_map<std::string, RasterProperties> &raster_properties = map.getStyle().computed.rasters;
const std::unordered_map<std::string, RasterProperties>::const_iterator raster_properties_it = raster_properties.find(layer_name);
if (raster_properties_it == raster_properties.end()) return;
const RasterProperties& properties = raster_properties_it->second;