From a1179904c022d6ccd22ebd00a4db2618a9d9ca34 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 17 Mar 2011 17:41:02 -0400 Subject: Performance and speed improvements. --- core/keys.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/keys.lua') diff --git a/core/keys.lua b/core/keys.lua index 5a60b3ee..b693d523 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -129,7 +129,6 @@ local ALT = 'a'..ADD -- Optimize for speed. local string = _G.string local string_char = string.char -local string_format = string.format local xpcall = _G.xpcall local next = _G.next local type = _G.type @@ -168,7 +167,7 @@ local keychain = {} -- Clears the current key sequence. local function clear_key_sequence() - keychain = {} + if #keychain > 0 then keychain = {} end gui.statusbar_text = '' end @@ -234,7 +233,7 @@ local function keypress(code, shift, control, alt) control = control and CTRL or '' shift = shift and SHIFT or '' alt = alt and ALT or '' - local key_seq = string_format('%s%s%s%s', control, shift, alt, key) + local key_seq = control..shift..alt..key if #keychain > 0 and key_seq == keys.clear_sequence then clear_key_sequence() -- cgit v1.2.3