diff options
author | Leandro Ribeiro <leandrohr@riseup.net> | 2019-12-30 19:11:51 -0300 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2020-08-26 14:10:50 +0000 |
commit | fd874ff53379ccdc6584fb4412e69889f94e186f (patch) | |
tree | 5d78893557ec9f3a5db7d87cdf7fd72178faae35 | |
parent | 67b382ccdc42ceb2e52e4de59b4de76e7a68aa09 (diff) | |
download | weston-fd874ff53379ccdc6584fb4412e69889f94e186f.tar.gz |
exposay: move constant value calculation out of loop
In exposay_layout(), int pad is being calculated within the
loop. This is unnecessary, as its value is constant. Move it
out of the loop.
Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
-rw-r--r-- | desktop-shell/exposay.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c index 9fd43834..b1a8d347 100644 --- a/desktop-shell/exposay.c +++ b/desktop-shell/exposay.c @@ -219,6 +219,7 @@ exposay_layout(struct desktop_shell *shell, struct shell_output *shell_output) struct weston_view *view; struct exposay_surface *esurface, *highlight = NULL; int w, h; + int pad; int i; int last_row_removed = 0; @@ -275,11 +276,10 @@ exposay_layout(struct desktop_shell *shell, struct shell_output *shell_output) if (eoutput->surface_size > (output->height / 2)) eoutput->surface_size = output->height / 2; + pad = eoutput->surface_size + eoutput->padding_inner; + i = 0; wl_list_for_each(view, &workspace->layer.view_list.link, layer_link.link) { - int pad; - - pad = eoutput->surface_size + eoutput->padding_inner; if (!get_shell_surface(view->surface)) continue; |