mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +00:00
AK: Use __builtin_memset() and such to reduce header dependencies
We can use __builtin_memset() without including <string.h>. This is pretty neat, as it will allow us to reduce the header deps of AK templates a bit, if applied consistently. Note that this is an enabling change for an upcoming #include removal.
This commit is contained in:
parent
b1058b33fb
commit
35d88f536c
Notes:
sideshowbarker
2024-07-19 08:50:32 +09:00
Author: https://github.com/awesomekling
Commit: 35d88f536c
5 changed files with 14 additions and 14 deletions
|
@ -177,7 +177,7 @@ public:
|
|||
return !cstring;
|
||||
if (!cstring)
|
||||
return false;
|
||||
return !strcmp(characters(), cstring);
|
||||
return !__builtin_strcmp(characters(), cstring);
|
||||
}
|
||||
|
||||
bool operator!=(const char* cstring) const
|
||||
|
@ -273,7 +273,7 @@ inline bool operator<(const char* characters, const String& string)
|
|||
if (string.is_null())
|
||||
return false;
|
||||
|
||||
return strcmp(characters, string.characters()) < 0;
|
||||
return __builtin_strcmp(characters, string.characters()) < 0;
|
||||
}
|
||||
|
||||
inline bool operator>=(const char* characters, const String& string)
|
||||
|
@ -289,7 +289,7 @@ inline bool operator>(const char* characters, const String& string)
|
|||
if (string.is_null())
|
||||
return false;
|
||||
|
||||
return strcmp(characters, string.characters()) > 0;
|
||||
return __builtin_strcmp(characters, string.characters()) > 0;
|
||||
}
|
||||
|
||||
inline bool operator<=(const char* characters, const String& string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue