From 1a91fd64b9081e955c529a210d91d74a85562adb Mon Sep 17 00:00:00 2001 From: Felix Date: Fri, 11 May 2012 17:42:45 +0200 Subject: [PATCH] Return condition value instead of conditional true/false Patterns like if condition then return true else return false end could be simplified to return condition Signed-off-by: Felix Signed-off-by: Uli Schlachter --- lib/awful/widget/tasklist.lua.in | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/awful/widget/tasklist.lua.in b/lib/awful/widget/tasklist.lua.in index c52e4cdd8..c3c47ef9e 100644 --- a/lib/awful/widget/tasklist.lua.in +++ b/lib/awful/widget/tasklist.lua.in @@ -154,8 +154,7 @@ end -- @return true if c is on screen, false otherwise function filter.alltags(c, screen) -- Only print client on the same screen as this widget - if c.screen ~= screen then return false end - return true + return c.screen == screen end --- Filtering function to include only the clients from currently selected tags. @@ -213,10 +212,7 @@ end -- @return true if c is focused on screen, false otherwise function filter.focused(c, screen) -- Only print client on the same screen as this widget - if c.screen == screen and capi.client.focus == c then - return true - end - return false + return c.screen == screen and capi.client.focus == c end setmetatable(_M, { __call = function(_, ...) return new(...) end })