Contains vs is in
hh
hh at hyperhh.de
Mon Jan 2 17:39:14 EST 2017
[There is always some crazy time overcrossing here, I posted half an hour before you.]
I have here the following result with your code (in average).
There is a "contains"-repeat and a "is in"-repeat.
If I use one as first and the other as second repeat loop I get that the one that is called first is a little bit faster ...
Isn't it that deep in the stomach of LC both use the same offset(substring, string) routine?
Richard G. wrote:
> Or you could test it:
>
> on mouseUp
> put 1000000 into n
>
> put the millisecs into t
> repeat n
> put ("this is a string with foo in it" contains "foo") into r2
> end repeat
> put the millisecs - t into t2
>
> put the millisecs into t
> repeat n
> put ("foo" is in "this is a string with foo in it") into r1
> end repeat
> put the millisecs - t into t1
>
> put t1 && t2
> end mouseUp
More information about the use-livecode
mailing list