From b45efeb4bd8ee1feebd719d4cbe151c1e346c623 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Thu, 3 Mar 2016 16:20:47 +0100 Subject: [PATCH] Inline initialize functional road classification hash table --- include/extractor/guidance/classification_data.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/extractor/guidance/classification_data.hpp b/include/extractor/guidance/classification_data.hpp index 3da016a33..754c4f2d4 100644 --- a/include/extractor/guidance/classification_data.hpp +++ b/include/extractor/guidance/classification_data.hpp @@ -44,7 +44,7 @@ enum class FunctionalRoadClass : std::uint8_t inline FunctionalRoadClass functionalRoadClassFromTag(std::string const &value) { // FIXME at some point this should be part of the profiles - const static auto initializeClassHash = []() + const static auto class_hash = [] { std::unordered_map hash; hash["motorway"] = FunctionalRoadClass::MOTORWAY; @@ -66,10 +66,7 @@ inline FunctionalRoadClass functionalRoadClassFromTag(std::string const &value) hash["path"] = FunctionalRoadClass::LOW_PRIORITY_ROAD; hash["driveway"] = FunctionalRoadClass::LOW_PRIORITY_ROAD; return hash; - }; - - static const std::unordered_map class_hash = - initializeClassHash(); + }(); if (class_hash.find(value) != class_hash.end()) {