From 2c1df41a16219057fc5f7bb65639dcf2af519326 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Mon, 27 Apr 2020 10:57:59 +0300 Subject: [PATCH] debug: optimize wp_log_level_is_enabled() Add the 'const' attribute to let the compiler know that it doesn't need to call it multiple times for the same debug level argument, since the enabled log levels cannot change at runtime. --- lib/wp/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wp/debug.h b/lib/wp/debug.h index d6d6bda9..2d1e4164 100644 --- a/lib/wp/debug.h +++ b/lib/wp/debug.h @@ -20,7 +20,7 @@ G_BEGIN_DECLS #define WP_OBJECT_ARGS(object) G_OBJECT_TYPE_NAME(object), object WP_API -gboolean wp_log_level_is_enabled (GLogLevelFlags log_level); +gboolean wp_log_level_is_enabled (GLogLevelFlags log_level) G_GNUC_CONST; WP_API GLogWriterOutput wp_log_writer_default (GLogLevelFlags log_level, -- GitLab