I like the experiment. I'd be curious to see what the results would be in enterprise software.
One small optimization I can think of: if the first character isn't an 'f' or 's', you can skip 4 characters ( fseek(file, 4, CURR_SET) ). Similarly for ({'u','h'}, 2), etc. You'll save traversals, lookups, and comparisons, which would be a boon in larger directories.
[+] [-] redthrowaway|14 years ago|reply
One small optimization I can think of: if the first character isn't an 'f' or 's', you can skip 4 characters ( fseek(file, 4, CURR_SET) ). Similarly for ({'u','h'}, 2), etc. You'll save traversals, lookups, and comparisons, which would be a boon in larger directories.
[+] [-] sambenson|14 years ago|reply