Re: Considering puzzle
Re: Considering puzzle
- Subject: Re: Considering puzzle
- From: Christopher Nebel <email@hidden>
- Date: Mon, 2 Sep 2002 21:29:15 -0700
On Thursday, August 22, 2002, at 05:11 PM, Nigel Garvey wrote:
>
While working on a script recently, I found that string comparisons
>
('contains', 'begins with', etc.) run faster when 'considering case'
>
than when 'ignoring case'. I assume this is because the strings'
>
characters don't need to be converted to a common case for the
>
comparisons.
Right.
>
Someone who tried the script for me pointed out that there's a 32767
>
character limit on this sort of comparison. [T]his limit doesn't
>
apply with 'considering case' - and that's totally puzzling. Does
>
anyone know what this limit's about, why it applies when ignoring
>
case, and why it doesn't when considering it?
If you think about your first conclusion a bit more, it'll make sense.
The various "ignoring" clauses are implemented by mangling the input
strings to remove the appropriate differences -- mapping everything to
uppercase, removing whitespace, etc. When you consider everything, it
means the strings are compared exactly as they are, so no
transformations are applied, and there's nothing to be limited. When
you ignore case, however, you need to apply a case transform, and the
API AppleScript uses to do that is limited to 32K worth of text, ergo,
the 32K limit. Yes, I know it's all rather bogus and lame, and I hope
to fix it someday.
--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.