Re: Problems with speed & issues with coercion in OS 9.2.2 (App
Re: Problems with speed & issues with coercion in OS 9.2.2 (App
- Subject: Re: Problems with speed & issues with coercion in OS 9.2.2 (App
- From: Nigel Garvey <email@hidden>
- Date: Sun, 27 Jan 2002 12:53:50 +0000
Arthur J Knapp wrote on Sat, 26 Jan 2002 18:10:52 -0500:
[Some excellent advice snipped]
>
The following should be much faster:
>
>
on IsFolder( string_or_alias )
>
>
-- We say "as alias" first to make sure that the item
>
-- exists, and to ensure that there is a colon at the
>
-- end of the path.
>
--
>
return ( ( string_or_alias as alias ) as string )'s item -1 = ":"
>
>
end IsFolder
'Ends with' is about twice as fast as 'item -1 =' in a straight race, so
that would contribute slightly more still to the speed here:
return (string_or_alias as alias as string) ends with ":"
NG