Skip to content

Commit

Permalink
Small cleanup to d7eab68
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Feb 18, 2021
1 parent ad1523f commit c26b13d
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/server/campaignd/server.cpp
Expand Up @@ -216,16 +216,12 @@ bool have_wml(const utils::optional_reference<const config>& cfg)
* Null WML objects are skipped.
*/
template<typename... Vals>
std::optional<std::vector<std::string>> multi_find_illegal_names(const Vals&... items)
std::optional<std::vector<std::string>> multi_find_illegal_names(const Vals&... args)
{
std::vector<std::string> names;
((items && check_names_legal(*items, &names)), ...);
((args && check_names_legal(*args, &names)), ...);

if(!names.empty()) {
return names;
} else {
return std::nullopt;
}
return !names.empty() ? std::optional(names) : std::nullopt;
}

/**
Expand All @@ -234,16 +230,12 @@ std::optional<std::vector<std::string>> multi_find_illegal_names(const Vals&...
* Null WML objects are skipped.
*/
template<typename... Vals>
std::optional<std::vector<std::string>> multi_find_case_conflicts(const Vals&... items)
std::optional<std::vector<std::string>> multi_find_case_conflicts(const Vals&... args)
{
std::vector<std::string> names;
((items && check_case_insensitive_duplicates(*items, &names)), ...);
((args && check_case_insensitive_duplicates(*args, &names)), ...);

if(!names.empty()) {
return names;
} else {
return std::nullopt;
}
return !names.empty() ? std::optional(names) : std::nullopt;
}

/**
Expand Down

0 comments on commit c26b13d

Please sign in to comment.