mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-13 22:40:03 -04:00
fix: don't unnecessarily call value_parser twice
This commit is contained in:
parent
1ff2878e23
commit
04119a91f8
@ -92,7 +92,7 @@ bool parse_metadata_requirements_set(T& container, folly::dynamic& req,
|
|||||||
v.asString(), name, e.what()));
|
v.asString(), name, e.what()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto maybe_value = value_parser(v)) {
|
if (maybe_value) {
|
||||||
if (!container.emplace(*maybe_value).second) {
|
if (!container.emplace(*maybe_value).second) {
|
||||||
throw std::runtime_error(fmt::format(
|
throw std::runtime_error(fmt::format(
|
||||||
"duplicate value '{}' for requirement '{}'", v.asString(), name));
|
"duplicate value '{}' for requirement '{}'", v.asString(), name));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user