mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:34:57 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -13,23 +13,23 @@
|
|||
|
||||
ErrorOr<int> serenity_main(Main::Arguments)
|
||||
{
|
||||
Core::DirIterator parser_tests(LexicalPath::join(Core::StandardPaths::home_directory(), "Tests/cpp-tests/parser").string());
|
||||
Core::DirIterator parser_tests(LexicalPath::join(Core::StandardPaths::home_directory(), "Tests/cpp-tests/parser"sv).string());
|
||||
while (parser_tests.has_next()) {
|
||||
auto cpp_full_path = parser_tests.next_full_path();
|
||||
if (!cpp_full_path.ends_with(".cpp"))
|
||||
if (!cpp_full_path.ends_with(".cpp"sv))
|
||||
continue;
|
||||
auto ast_full_path = cpp_full_path.replace(".cpp", ".ast", ReplaceMode::FirstOnly);
|
||||
auto ast_full_path = cpp_full_path.replace(".cpp"sv, ".ast"sv, ReplaceMode::FirstOnly);
|
||||
outln("{}", cpp_full_path);
|
||||
auto res = Core::command("/bin/sh", { "-c", String::formatted("cpp-parser {} > {}", cpp_full_path, ast_full_path) }, {});
|
||||
VERIFY(!res.is_error());
|
||||
}
|
||||
|
||||
Core::DirIterator preprocessor_tests(LexicalPath::join(Core::StandardPaths::home_directory(), "Tests/cpp-tests/preprocessor").string());
|
||||
Core::DirIterator preprocessor_tests(LexicalPath::join(Core::StandardPaths::home_directory(), "Tests/cpp-tests/preprocessor"sv).string());
|
||||
while (preprocessor_tests.has_next()) {
|
||||
auto cpp_full_path = preprocessor_tests.next_full_path();
|
||||
if (!cpp_full_path.ends_with(".cpp"))
|
||||
if (!cpp_full_path.ends_with(".cpp"sv))
|
||||
continue;
|
||||
auto ast_full_path = cpp_full_path.replace(".cpp", ".txt", ReplaceMode::FirstOnly);
|
||||
auto ast_full_path = cpp_full_path.replace(".cpp"sv, ".txt"sv, ReplaceMode::FirstOnly);
|
||||
outln("{}", cpp_full_path);
|
||||
auto res = Core::command("/bin/sh", { "-c", String::formatted("cpp-preprocessor {} > {}", cpp_full_path, ast_full_path) }, {});
|
||||
VERIFY(!res.is_error());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue