> On Tue, Sep 9, 2008 at 5:57 AM, Sébastien Lorion
> <sebastien.lorion@gmai...> wrote:
> > My bottom line is, if I control the data and I am 100% sure it won't
> > problematic chars, then by all means, I will use ordinal compare and get
> > speed increase. Otherwise, as a non English native myself, I want to make
> > apps international and so, I will use the culture aware comparison (and
> > other operations).
> Just be careful what you use the comparison for... Note this highly
> rated Connect "Won't Fix":
> https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=236900 >
> I bet this'd be a bugger of a bug to locate.
> In this snippet you'd expect the two SortedLists to be identical, but
> they're not, and the reason's clear -- the strings are s1<s2<s3<s1!
> Dim s1 As String = "-0.67:-0.33:0.33"
> Dim s2 As String = "0.67:-0.33:0.33"
> Dim s3 As String = "-0.67:0.33:-0.33"
> Dim l, m As New SortedList(Of String, Integer)
> For Each i in m
> For Each j in l
> Now I know why FXCop and the built-in VS2008 Code Analysis always says
> to specify the comparer and cultureinfo -- it's not just for performance!
> Mark Hurd, B.Sc.(Ma.) (Hons.)
> This list is hosted by DevelopMentor(R) http://www.develop.com >
> View archives and manage your subscription(s) at
> http://discuss.develop.com >