I think that you are overlooking an obvious optimization. If the file-names come to you in alphabetical order, as they most-commonly do, then all occurrences of baz.anything will necessarily be consecutive. Simply split each filename by "." into two pieces (filename, extension), and notice if the name is different from the previous filename you encountered (or if it is the very first one). In this case, test the list of extensions that you had been accumulating to see if both .epub and .pdf are present in that list, then reset the list. You never have to “search” for anything, nor do you ever need to store more than two names: “this” one, and the “immediately previous” one.
In reply to Re: Duplicates in Directories
by Anonymous Monk
in thread Duplicates in Directories
by kel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |