diff --git a/profiles/lib/tag_cache.lua b/profiles/lib/tag_cache.lua index b01efd2c0..dac8f6a71 100644 --- a/profiles/lib/tag_cache.lua +++ b/profiles/lib/tag_cache.lua @@ -2,25 +2,14 @@ TagCache = {} function TagCache.get(way,cache,key) local v = cache[key] - if v then - if v == '' then - return nil - else - return v - end - else + if v == nil then v = way:get_value_by_key(key) - if v == nil then - cache[key] = '' - return nil - else - cache[key] = v - if v == '' then - return nil - else - return v - end - end + cache[key] = v or false + return v + elseif v == false then + return nil + else + return v end end diff --git a/src/extractor/scripting_environment_lua.cpp b/src/extractor/scripting_environment_lua.cpp index 283d8b47b..c503192ab 100644 --- a/src/extractor/scripting_environment_lua.cpp +++ b/src/extractor/scripting_environment_lua.cpp @@ -34,7 +34,7 @@ namespace template auto get_value_by_key(T const &object, const char *key) -> decltype(object.get_value_by_key(key)) { - return object.get_value_by_key(key, ""); + return object.get_value_by_key(key); } template double latToDouble(T const &object)