Skip to content

Commit d454eef

Browse files
committed
Split alpha-numeric check lambda
1 parent f15ca6b commit d454eef

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

libs/libGamedata/gameData/CampaignDescription.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ CampaignDescription::CampaignDescription(const boost::filesystem::path& campaign
2626
if(!parentPath.parent_path().has_parent_path())
2727
{
2828
// Only alpha-numeric folder names are allowed
29-
const auto isNonAlNum = [](const char c) {
30-
return !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'));
29+
const auto isAlNum = [](const char c) {
30+
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9');
3131
};
32+
const auto isNonAlNum = [isAlNum](const char c) { return !isAlNum(c); };
3233
lua::assertTrue(!helpers::contains_if(parentPath.string(), isNonAlNum),
3334
helpers::format(_("Invalid path '%1%': Must be alpha-numeric"), path));
3435
return (campaignPath / tmpPath).string();

0 commit comments

Comments
 (0)