From fb151c33403e4d69642902ed7beed87b84c7765b Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 21 Sep 2019 13:43:35 +0200 Subject: [PATCH 1/2] Remove some dead code in notification:reset_timeout() This code is inside an "if new_timeout and [something else]". Thus, it only executes when new_timeout is "truthy". Thus, "new_timeout or [whatever]" will always evaluate to "new_timeout". This commit removes that tiny bit of dead code. Signed-off-by: Uli Schlachter --- lib/naughty/notification.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/naughty/notification.lua b/lib/naughty/notification.lua index 985c1589f..9bd4b05f8 100644 --- a/lib/naughty/notification.lua +++ b/lib/naughty/notification.lua @@ -467,7 +467,7 @@ function notification:reset_timeout(new_timeout) -- Do not set `self.timeout` to `self.timeout` since that would create the -- timer before the constructor ends. if new_timeout and self.timer then - self.timeout = new_timeout or self.timeout + self.timeout = new_timeout end if self.timer and not self.timer.started then From 0bc22aea857cb399988124ecbaa03c229fb14847 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 21 Sep 2019 13:44:38 +0200 Subject: [PATCH 2/2] client shims: Remove some duplicate code Both commit 44e6b2d24e983 and 4eda67ce54 added the same function to this file (and by the commit message, the later was intended to do so, while the former has an unrelated commit message (but does not contain any other changes)). Signed-off-by: Uli Schlachter --- tests/examples/shims/client.lua | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/examples/shims/client.lua b/tests/examples/shims/client.lua index c65e3d033..758c293fc 100644 --- a/tests/examples/shims/client.lua +++ b/tests/examples/shims/client.lua @@ -200,14 +200,6 @@ function client.gen_fake(args) return ret.data._struts end - function ret:struts(new) - for k, v in pairs(new or {}) do - ret.data._struts[k] = v - end - - return ret.data._struts - end - -- Set a dummy one for now since set_screen will corrupt it. ret._old_geo = {}