Descriptionpath/filepath: steer people away from HasPrefix
The strikes against it are:
1. It does not take path boundaries into account.
2. It assumes that Windows==case-insensitive file system
and non-Windows==case-sensitive file system, neither of
which is always true.
3. Comparing ToLower against ToLower is not a correct
implementation of a case-insensitive string comparison.
4. If it returns true on Windows you still don't know how long
the matching prefix is in bytes, so you can't compute what
the suffix is.
Patch Set 1 #Patch Set 2 : diff -r b1f0c3b7a935 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r b1f0c3b7a935 https://go.googlecode.com/hg/ #Patch Set 4 : diff -r 37763a8d9c71 https://go.googlecode.com/hg/ #
MessagesTotal messages: 6
|