GtkCSSImage: Avoid some type checks

The width/height/aspect getters are called a lot, and almost all
callers already verify it from _gtk_css_image_get_concrete_size (),
so just skip these checks.
This commit is contained in:
Alexander Larsson 2017-01-11 15:28:35 +01:00
parent 7bee22bcb6
commit 8cabfef9c9

View File

@ -156,8 +156,6 @@ _gtk_css_image_get_width (GtkCssImage *image)
{
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), 0);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->get_width (image);
@ -168,8 +166,6 @@ _gtk_css_image_get_height (GtkCssImage *image)
{
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), 0);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->get_height (image);
@ -180,8 +176,6 @@ _gtk_css_image_get_aspect_ratio (GtkCssImage *image)
{
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), 0);
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->get_aspect_ratio (image);