niacdoial / blemd

BMD importer for blender (BDL format also partially supported)
GNU General Public License v3.0
32 stars 12 forks source link

Fix bug in common.getFiles() #67

Closed Sage-of-Mirrors closed 1 year ago

Sage-of-Mirrors commented 1 year ago

Currently, there is a bug in common.getFiles() in which wc_name is modified in each iteration of the for com in files: loop. Because the regex is regenerated within the loop as well, this means that only the first iteration of the loop will find a matching file; all other iterations will fail to find regex matches. This PR moves the modification of wc_name and the generation of the regex outside the loop.

niacdoial commented 1 year ago

actually there was no bug here, since str.replace() doesn't modify the original object. Still, quite the optimisation, thanks!