summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2022-12-29 18:54:53 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2023-01-18 12:15:47 +0000
commitab8cdb07dece52f0226a1d0346157b6f172ed1ba (patch)
tree229bd577a5662761f8f19499dedfdfb805683178
parent8373f328bd1e996a1521eed3f962af873cfa14a0 (diff)
downloadglib-ab8cdb07dece52f0226a1d0346157b6f172ed1ba.tar.gz
gvariant: Remove some unnecessary type assertions on a hot path
While checking the validity of a `GVariantTypeInfo` is good, this code path is very hot, and I’ve never seen these assertions catch a bug in practice. Lean more towards the performance side of the performance/correctness tradeoff in this case, by removing the assertions here. They remain in place in a number of other `GVariantTypeInfo` code paths, so invalid `GVariantTypeInfo` pointers should hopefully still be caught quickly. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--glib/gvarianttypeinfo.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/glib/gvarianttypeinfo.c b/glib/gvarianttypeinfo.c
index 2b310581c..4e2e9c5b4 100644
--- a/glib/gvarianttypeinfo.c
+++ b/glib/gvarianttypeinfo.c
@@ -247,8 +247,6 @@ g_variant_type_info_query (GVariantTypeInfo *info,
guint *alignment,
gsize *fixed_size)
{
- g_variant_type_info_check (info, 0);
-
if (alignment)
*alignment = info->alignment;