srctree

Robin Linden parent d3135763 0aee230c
css: Fix get_and_erase returning an empty string if the key isn't found

inlinesplit
css/parser_test.cpp added: 6, removed: 3, total 3
@@ -70,8 +70,11 @@ bool check_initial_font_values(std::map<std::string, std::string, std::less<>> c
}
 
template<class KeyT, class ValueT>
ValueT get_and_erase(std::map<KeyT, ValueT, std::less<>> &map, KeyT key) {
ValueT value = map[key];
ValueT get_and_erase(std::map<KeyT, ValueT, std::less<>> &map,
KeyT key,
etest::source_location const &loc = etest::source_location::current()) {
require(map.contains(key), loc);
ValueT value = map.at(key);
map.erase(key);
return value;
}