1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 13:57:34 +00:00

AK: Run clang-format on StringUtils.{cpp,h}

This commit is contained in:
Andreas Kling 2020-03-22 13:04:04 +01:00
parent cccbe43056
commit 0efa47b7ef
2 changed files with 95 additions and 95 deletions

View file

@ -33,8 +33,8 @@ namespace AK {
namespace StringUtils { namespace StringUtils {
bool matches(const StringView& str, const StringView& mask, CaseSensitivity case_sensitivity) bool matches(const StringView& str, const StringView& mask, CaseSensitivity case_sensitivity)
{ {
if (str.is_null() || mask.is_null()) if (str.is_null() || mask.is_null())
return str.is_null() && mask.is_null(); return str.is_null() && mask.is_null();
@ -84,10 +84,10 @@ namespace StringUtils {
// If we 'ate' all of the mask and the string then we match. // If we 'ate' all of the mask and the string then we match.
return (mask_ptr == mask_end) && string_ptr == string_end; return (mask_ptr == mask_end) && string_ptr == string_end;
} }
int convert_to_int(const StringView& str, bool& ok) int convert_to_int(const StringView& str, bool& ok)
{ {
if (str.is_empty()) { if (str.is_empty()) {
ok = false; ok = false;
return 0; return 0;
@ -118,10 +118,10 @@ namespace StringUtils {
ok = true; ok = true;
return negative ? -value : value; return negative ? -value : value;
} }
unsigned convert_to_uint(const StringView& str, bool& ok) unsigned convert_to_uint(const StringView& str, bool& ok)
{ {
if (str.is_empty()) { if (str.is_empty()) {
ok = false; ok = false;
return 0; return 0;
@ -141,7 +141,7 @@ namespace StringUtils {
ok = true; ok = true;
return value; return value;
} }
} }

View file

@ -38,9 +38,9 @@ enum class CaseSensitivity {
namespace StringUtils { namespace StringUtils {
bool matches(const StringView& str, const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive); bool matches(const StringView& str, const StringView& mask, CaseSensitivity = CaseSensitivity::CaseInsensitive);
int convert_to_int(const StringView&, bool& ok); int convert_to_int(const StringView&, bool& ok);
unsigned convert_to_uint(const StringView&, bool& ok); unsigned convert_to_uint(const StringView&, bool& ok);
} }