From 6e0fc5e22110f83688a9cd96853844a8acfda214 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Tue, 13 Jun 2023 19:10:22 -0400 Subject: [PATCH] LibGfx: Remove a `static` on a method in a .h file Methods defined in header files should generally be `inline`, not `static`. `static` means that each translation unit will have its own local copy of the function when the function isn't inlined and it's up to the linker's identical code folding to hopefully merge the potentially many copies in the program. `inline` means that the linker can put the identical copies in a comdat and merge them by name, without having to compare contents. No behavior change. --- Userland/Libraries/LibGfx/Bitmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Bitmap.h b/Userland/Libraries/LibGfx/Bitmap.h index 786af81287..1243636abd 100644 --- a/Userland/Libraries/LibGfx/Bitmap.h +++ b/Userland/Libraries/LibGfx/Bitmap.h @@ -66,7 +66,7 @@ enum class StorageFormat { RGBA8888, }; -static StorageFormat determine_storage_format(BitmapFormat format) +inline StorageFormat determine_storage_format(BitmapFormat format) { switch (format) { case BitmapFormat::BGRx8888: