mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
AK: Make Utf8View constructors inline and remove C string constructor
Using StringView instead of C strings is basically always preferable. The only reason to use a C string is because you are calling a C API.
This commit is contained in:
parent
291dbff2e1
commit
1be4cbd639
9 changed files with 36 additions and 42 deletions
|
@ -196,13 +196,13 @@ int main(int argc, char** argv)
|
|||
return status;
|
||||
}
|
||||
|
||||
static int print_escaped(const char* name)
|
||||
static int print_escaped(StringView name)
|
||||
{
|
||||
int printed = 0;
|
||||
|
||||
Utf8View utf8_name(name);
|
||||
if (utf8_name.validate()) {
|
||||
printf("%s", name);
|
||||
out("{}", name);
|
||||
return utf8_name.length();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue