[Num Glob vs list_directory]

I doubt that the regex matching is the slow part, but I can understand that 
listing all files in the directories and then filtering the ones we are not 
interested in is slow. The numglob is only checking if files exist, which will 
be faster.

But I just grepped the source code and realized that we never use the regular 
expression ability of list_directory anywhere except tests. How about changing 
it to do the work of NumGlob? I mean renaming it to path.list_files(pattern) 
(or something better). All "?" in pattern is replaced through numbers and we 
return a lua table with the filenames. We then guarantee that those files exist 
and we can already in the Lua dictionaries check that we have indeed pictures, 
i.e. that the config is sane. Right now, we only do it at load time


-- 
https://code.launchpad.net/~widelands-dev/widelands/one_tribe/+merge/274832
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/one_tribe into lp:widelands.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to