From d6af9f74c5ae265eb5fd3b77f0ba773cbbb67944 Mon Sep 17 00:00:00 2001 From: David Briscoe Date: Wed, 2 Mar 2022 10:15:20 -0800 Subject: [PATCH] lint: Don't set unused locals Not a bug, but pointless to store this variable since it's not used. --- .luacheckrc | 1 - stringx.lua | 2 -- 2 files changed, 3 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index c1fd21a..2805ba7 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -5,7 +5,6 @@ return { "212", -- Unused argument. "212/self", -- Unused argument self. "213", -- Unused loop variable. - "231", -- Local variable is set but never accessed. "311", -- Value assigned to a local variable is unused. "631", -- Line is too long. }, diff --git a/stringx.lua b/stringx.lua index 7b6dc6a..5ef58d4 100644 --- a/stringx.lua +++ b/stringx.lua @@ -171,9 +171,7 @@ function stringx.deindent(s, keep_trailing_empty) --split along newlines local lines = stringx.split(s, newline) --detect and strip any leading blank lines - local leading_newline = false while lines[1] == "" do - leading_newline = true table.remove(lines, 1) end