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>
This commit is contained in:
Philip Withnall 2022-12-29 18:54:53 +00:00
parent 8373f328bd
commit ab8cdb07de

View File

@ -247,8 +247,6 @@ g_variant_type_info_query (GVariantTypeInfo *info,
guint *alignment, guint *alignment,
gsize *fixed_size) gsize *fixed_size)
{ {
g_variant_type_info_check (info, 0);
if (alignment) if (alignment)
*alignment = info->alignment; *alignment = info->alignment;