From 2066415f82ba4fdda8d6f3020024d9fbf997e3da Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 25 Jan 2009 21:09:41 -0500 Subject: Replaced str:match with str:find where applicable for speed improvements. --- core/ext/command_entry.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/ext/command_entry.lua') diff --git a/core/ext/command_entry.lua b/core/ext/command_entry.lua index 29e38bb6..c583dc06 100644 --- a/core/ext/command_entry.lua +++ b/core/ext/command_entry.lua @@ -16,18 +16,18 @@ function ce.get_completions_for(command) if type(tbl) ~= 'table' then return end local cmpls = {} for k in pairs(tbl) do - if type(k) == 'string' and k:match('^'..prefix) then + if type(k) == 'string' and k:find('^'..prefix) then cmpls[#cmpls + 1] = k end end if path == 'buffer' then if o == ':' then for f in pairs(textadept.buffer_functions) do - if f:match('^'..prefix) then cmpls[#cmpls + 1] = f end + if f:find('^'..prefix) then cmpls[#cmpls + 1] = f end end else for p in pairs(textadept.buffer_properties) do - if p:match('^'..prefix) then cmpls[#cmpls + 1] = p end + if p:find('^'..prefix) then cmpls[#cmpls + 1] = p end end end end -- cgit v1.2.3