mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
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:
parent
7bee22bcb6
commit
8cabfef9c9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user