1
0
Fork 0

backends/x11: Make zero comparisons earlier and easier to reason about

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3062>
This commit is contained in:
Daniel van Vugt 2023-06-08 17:27:22 +08:00
parent b3d0d84823
commit 150b110726

View file

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