Avoid calling getters twice

This commit is contained in:
Sebastian Ramacher 2018-11-27 23:20:28 +01:00
parent 71e9ed2df3
commit b0b05d9aa1

View file

@ -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