1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +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:
sin-ack 2022-07-11 17:32:29 +00:00 committed by Andreas Kling
parent e5f09ea170
commit 3f3f45580a
762 changed files with 8315 additions and 8316 deletions

View file

@ -23,7 +23,7 @@
TEST_CASE(test_bmp)
{
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgba32-1.bmp").release_value();
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgba32-1.bmp"sv).release_value();
auto bmp = Gfx::BMPImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(bmp.frame_count());
@ -37,7 +37,7 @@ TEST_CASE(test_bmp)
TEST_CASE(test_gif)
{
auto file = Core::MappedFile::map("/res/graphics/download-animation.gif").release_value();
auto file = Core::MappedFile::map("/res/graphics/download-animation.gif"sv).release_value();
auto gif = Gfx::GIFImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(gif.frame_count());
@ -52,7 +52,7 @@ TEST_CASE(test_gif)
TEST_CASE(test_ico)
{
// FIXME: Use an ico file
auto file = Core::MappedFile::map("/res/graphics/buggie.png").release_value();
auto file = Core::MappedFile::map("/res/graphics/buggie.png"sv).release_value();
auto ico = Gfx::ICOImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(ico.frame_count());
@ -65,7 +65,7 @@ TEST_CASE(test_ico)
TEST_CASE(test_jpg)
{
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgb24.jpg").release_value();
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgb24.jpg"sv).release_value();
auto jpg = Gfx::JPGImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(jpg.frame_count());
@ -79,7 +79,7 @@ TEST_CASE(test_jpg)
TEST_CASE(test_pbm)
{
auto file = Core::MappedFile::map("/res/html/misc/pbmsuite_files/buggie-raw.pbm").release_value();
auto file = Core::MappedFile::map("/res/html/misc/pbmsuite_files/buggie-raw.pbm"sv).release_value();
auto pbm = Gfx::PBMImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(pbm.frame_count());
@ -93,7 +93,7 @@ TEST_CASE(test_pbm)
TEST_CASE(test_pgm)
{
auto file = Core::MappedFile::map("/res/html/misc/pgmsuite_files/buggie-raw.pgm").release_value();
auto file = Core::MappedFile::map("/res/html/misc/pgmsuite_files/buggie-raw.pgm"sv).release_value();
auto pgm = Gfx::PGMImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(pgm.frame_count());
@ -107,7 +107,7 @@ TEST_CASE(test_pgm)
TEST_CASE(test_png)
{
auto file = Core::MappedFile::map("/res/graphics/buggie.png").release_value();
auto file = Core::MappedFile::map("/res/graphics/buggie.png"sv).release_value();
auto png = Gfx::PNGImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(png.frame_count());
@ -121,7 +121,7 @@ TEST_CASE(test_png)
TEST_CASE(test_ppm)
{
auto file = Core::MappedFile::map("/res/html/misc/ppmsuite_files/buggie-raw.ppm").release_value();
auto file = Core::MappedFile::map("/res/html/misc/ppmsuite_files/buggie-raw.ppm"sv).release_value();
auto ppm = Gfx::PPMImageDecoderPlugin((u8 const*)file->data(), file->size());
EXPECT(ppm.frame_count());