• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sort items in a list without OSAXen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Sort items in a list without OSAXen
      • From: Paul Skinner <email@hidden>
References: 
 >Re: Sort items in a list without OSAXen (From: Arthur J Knapp <email@hidden>)

  • Prev by Date: Re: Move replacing
  • Next by Date: Re: Sort items in a list without OSAXen
  • Previous by thread: Re: Sort items in a list without OSAXen
  • Next by thread: Re: Sort items in a list without OSAXen
  • Index(es):
    • Date
    • Thread