When searching for string "abcdefghij":
"Case sensitive" checkbox off: 140 sec
"Case sensitive" checkbox on: 136 sec
When searching for string "0123456789":
"Case sensitive" checkbox off: 145 sec
"Case sensitive" checkbox on: 140 sec
I repeated this experiment three times and always got same results. In particular, when searching with "Case sensitive" checkbox on, the search process is always faster; this is rather obvious and expected, because file contents don't have to be lowercased or uppercased before the comparison.
But: search results for the "0123456789" string will always be the same, regardless of the "Case sensitive" setting. This is because LowerCase("0123456789") == UpperCase("0123456789") == "0123456789". So, when LowerCase(SearchStr) == UpperCase(SearchStr), the search process could always behave as when "Case sensitive" option is on (which is faster):
This could be used at least in:if "Case sensitive" checkbox on
=> search case-sensitively
else
if LowerCase(SearchStr) == UpperCase(SearchStr)
=> search case-sensitively // Improvement here
else
=> search case-insensitively
(Note: in Delphi, AnsiLowerCase and AnsiUpperCase should probably be used instead)
- Lister,
- "Find Files" dialog with "Find text" option on.
Regards