Re: Sort items in a list without OSAXen
Re: Sort items in a list without OSAXen
- Subject: Re: Sort items in a list without OSAXen
- From: Shane Stanley <email@hidden>
- Date: Wed, 05 Sep 2001 08:44:00 +1000
On 4/9/01 11:57 PM +1000, Arthur J Knapp, email@hidden, wrote:
>
A slight speed improvement for larger lists can be obtained by
>
using AppleScript's pattern setting:
>
>
>> on getsumofhighestthree(UnsortedList)
>
>
>> -- set a to 0 --the lowest possible value in UnsortedList
>
>> -- set b to a
>
>> -- set c to a
>
>
set {a, b, c} to {0, 0, 0}
Isn't the latter a mirage? I mean, if I send something like it to an app, it
still sends three events.
And if I run:
set time1 to the ticks
repeat 10000 times
set a to 0
set b to a
set c to a
end repeat
set time2 to the ticks
repeat 10000 times
set {a, b, c} to {0, 0, 0}
end repeat
set time3 to the ticks
{time2 - time1, time3 - time2}
I get something like {10, 78}.
--
Shane Stanley, email@hidden