Do not validate a GValue initialized with the default

There's really no point in going through validation, if we know the
value we're validating is coming straight from the GParamSpec.
This commit is contained in:
Emmanuele Bassi 2019-10-26 14:04:26 +01:00
parent 6ad799ac67
commit f7824da85f

View File

@ -912,8 +912,11 @@ param_value_array_validate (GParamSpec *pspec,
g_param_value_set_default (element_spec, element);
changed++;
}
/* validate array value against element_spec */
changed += g_param_value_validate (element_spec, element);
else
{
/* validate array value against element_spec */
changed += g_param_value_validate (element_spec, element);
}
}
}
}