[Mono-dev] PATCH for String.StartsWith(string, StringComparison)

Paolo Molaro lupus at ximian.com
Fri Feb 3 05:06:48 EST 2006


On 02/03/06 Paolo Molaro wrote:
> The committed code is only marginally slower so most of the time it
> wouldn't be a big deal. But the other property  of the original version
> is that the JIT will be able to optimize it away when the method is
> called with a constant StringComparison value, which happens most of
> the time. This is much more difficult with the committed version.

I committed the change. In the future we should also probably have
a static readonly invariantcompareinfo to avoid doing too many
lookups. And of course the same in a thread local for the current culture.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list