On Tue, Sep 9, 2008 at 5:57 AM, Sébastien Lorion
> My bottom line is, if I control the data and I am 100% sure it won't contain
> problematic chars, then by all means, I will use ordinal compare and get the
> speed increase. Otherwise, as a non English native myself, I want to make my
> 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":
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!