From 150b1107262c0adc55706f6d367547be1d8cf593 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Thu, 8 Jun 2023 17:27:22 +0800 Subject: [PATCH] backends/x11: Make zero comparisons earlier and easier to reason about Part-of: --- src/backends/x11/meta-gpu-xrandr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backends/x11/meta-gpu-xrandr.c b/src/backends/x11/meta-gpu-xrandr.c index 404629024..f8f4b1a73 100644 --- a/src/backends/x11/meta-gpu-xrandr.c +++ b/src/backends/x11/meta-gpu-xrandr.c @@ -92,12 +92,12 @@ calculate_xrandr_refresh_rate (XRRModeInfo *xmode) float h_total; float v_total; + if (xmode->hTotal == 0 || xmode->vTotal == 0) + return 0.0; + h_total = (float) xmode->hTotal; v_total = (float) xmode->vTotal; - if (h_total == 0.0 || v_total == 0.0) - return 0.0; - if (xmode->modeFlags & RR_DoubleScan) v_total *= 2.0;