From 6022805772c5f2897699f1e825f030e5db4635d7 Mon Sep 17 00:00:00 2001
From: Felix <[email protected]>
Date: Fri, 11 May 2012 16:52:24 +0200
Subject: [PATCH] Return condition value instead of conditional
true/false in
 tasklist.filter.{currenttag,focused}

Patterns like

if condition then
  return true
else
  return false
end

could be simplified to

return condition

Is that something wanted in the awesome code base? I'm fine with the
rejection of this patch in favour of readability.

Signed-off-by: Felix <[email protected]>
---
 lib/awful/widget/tasklist.lua.in |    8 ++------
 1 Datei geändert, 2 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)

diff --git a/lib/awful/widget/tasklist.lua.in
b/lib/awful/widget/tasklist.lua.in
index c52e4cd..c3c47ef 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 })
-- 
1.7.10.1


Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to