diff options
author | 2009-01-25 21:09:41 -0500 | |
---|---|---|
committer | 2009-01-25 21:09:41 -0500 | |
commit | 2066415f82ba4fdda8d6f3020024d9fbf997e3da (patch) | |
tree | 4d7f591a9d02ac48ad024a2956f8f13ef26f6a1c /core/ext/pm | |
parent | f0dceb28f133d8392c8947155dc8582ec7737783 (diff) | |
download | textadept-2066415f82ba4fdda8d6f3020024d9fbf997e3da.tar.gz textadept-2066415f82ba4fdda8d6f3020024d9fbf997e3da.zip |
Replaced str:match with str:find where applicable for speed improvements.
Diffstat (limited to 'core/ext/pm')
-rw-r--r-- | core/ext/pm/file_browser.lua | 2 | ||||
-rw-r--r-- | core/ext/pm/modules_browser.lua | 4 | ||||
-rw-r--r-- | core/ext/pm/project_browser.lua | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/core/ext/pm/file_browser.lua b/core/ext/pm/file_browser.lua index 87d4b8e6..7c03518a 100644 --- a/core/ext/pm/file_browser.lua +++ b/core/ext/pm/file_browser.lua @@ -23,7 +23,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 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 diff --git a/core/ext/pm/project_browser.lua b/core/ext/pm/project_browser.lua index 0219839e..9a6c078a 100644 --- a/core/ext/pm/project_browser.lua +++ b/core/ext/pm/project_browser.lua @@ -52,7 +52,7 @@ function get_contents_for(full_path) else local dirpath = full_path[#full_path] for name in lfs.dir(dirpath) do - if not name:match('^%.') then -- ignore hidden files + if not name:find('^%.') then -- ignore hidden files local filepath = dirpath..'/'..name contents[filepath] = { text = name } if lfs.attributes(dirpath..'/'..name, 'mode') == 'directory' then @@ -322,7 +322,7 @@ function perform_menu_action(menu_item, menu_id, selected_item) else 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 |