• 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: Renaming files in Finder: why so slow?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming files in Finder: why so slow?


  • Subject: Re: Renaming files in Finder: why so slow?
  • From: Emmanuel <email@hidden>
  • Date: Sun, 31 Aug 2003 13:19:41 +0200

At 11:07 AM +0100 8/31/03, Nigel Garvey wrote:
> on doUnderScore(theList)
[...]
> repeat with thisItem in theList
[...]
> my doUnderScore(thisItem)
[...]
> end repeat
[...]
> end doUnderScore

This is a circumstance where recursivity is only a comfort issue, the algorithm is not intrinsically recursive. Recursive routines should be avoided whenever possible, I think. A recursive algorithm is that algorithm that always works like a charm except the day you would *really* need.

Here I think that it is enough to:
1. maintain a global "theList"
2. replacing the call to "my doUnderScore" with something by "set end of theList to thisItem"
3. instead of calling once doUnderScore, call it with "repeat while theList's length is 0"

Emmanuel
_______________________________________________
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.

References: 
 >Re: Renaming files in Finder: why so slow? (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: machine code (was Re: script changes)
  • Next by Date: Re: Renaming files in Finder: why so slow?
  • Previous by thread: Re: Renaming files in Finder: why so slow?
  • Next by thread: error 10
  • Index(es):
    • Date
    • Thread