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

@@ -9,8 +9,8 @@ void Painter::renderLine(LineBucket& bucket, const std::string& layer_name, cons
if (pass == Opaque) return;
if (!bucket.hasData()) return;
auto line_properties = map.getStyle().computed.lines;
auto line_properties_it = line_properties.find(layer_name);
const std::unordered_map<std::string, LineProperties> &line_properties = map.getStyle().computed.lines;
const std::unordered_map<std::string, LineProperties>::const_iterator line_properties_it = line_properties.find(layer_name);
if (line_properties_it == line_properties.end()) return;
const LineProperties& properties = line_properties_it->second;