generated from Sithas/conan_template
Перепись с const std::string& на std::string_view
This commit is contained in:
@@ -97,16 +97,16 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool ValidateLogin(const std::string& login)
|
||||
bool ValidateLogin(std::string_view login)
|
||||
{
|
||||
if (login.size() < 3 || login.size() > 50) return false;
|
||||
|
||||
std::regex pattern(std::string("^[A-Za-z0-9_]+$"));
|
||||
|
||||
return std::regex_match(login, pattern);
|
||||
return std::regex_match(login.data(), pattern);
|
||||
}
|
||||
|
||||
bool ValidatePassword(const std::string& password)
|
||||
bool ValidatePassword(std::string_view password)
|
||||
{
|
||||
return password.size() >= 5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user