Commit b0b05d9a authored by Sebastian Ramacher's avatar Sebastian Ramacher

Avoid calling getters twice

parent 71e9ed2d
......@@ -158,11 +158,11 @@ page_is_visible(zathura_document_t *document, unsigned int page_number)
void
zathura_adjustment_set_value(GtkAdjustment* adjustment, gdouble value)
{
gtk_adjustment_set_value(adjustment,
MAX(gtk_adjustment_get_lower(adjustment),
MIN(gtk_adjustment_get_upper(adjustment) -
gtk_adjustment_get_page_size(adjustment),
value)));
const gdouble lower = gtk_adjustment_get_lower(adjustment);
const gdouble upper_m_size = gtk_adjustment_get_upper(adjustment) -
gtk_adjustment_get_page_size(adjustment);
gtk_adjustment_set_value(adjustment, MAX(lower, MIN(upper_m_size, value)));
}
gdouble
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment