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/pm/modules_browser.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/ext/pm/modules_browser.lua') diff --git a/core/ext/pm/modules_browser.lua b/core/ext/pm/modules_browser.lua index 757e7d93..5cf93d25 100644 --- a/core/ext/pm/modules_browser.lua +++ b/core/ext/pm/modules_browser.lua @@ -88,7 +88,7 @@ function get_contents_for(full_path) local dir = {} local dirpath = table.concat(full_path, '/') for name in lfs.dir(dirpath) do - if not name:match('^%.') then + if not name:find('^%.') then dir[name] = { text = name } if lfs.attributes(dirpath..'/'..name, 'mode') == 'directory' then dir[name].parent = true @@ -173,7 +173,7 @@ function perform_menu_action(menu_item, menu_id, selected_item) }) == '1' then local function remove_directory(dirpath) for name in lfs.dir(dirpath) do - if not name:match('^%.%.?$') then os.remove(dirpath..'/'..name) end + if not name:find('^%.%.?$') then os.remove(dirpath..'/'..name) end end lfs.rmdir(dirpath) end -- cgit v1.2.3