Hi Alex,

> Am 19.08.2017 um 16:57 schrieb Alex Tweedly via use-livecode 
> <use-livecode@lists.runrev.com>:
> 
> Hmmm - you haven't mentioned how much data you're working with.

not sure, but definitively less than 5000.

> Using lineoffset() to check for duplicated keys will make you (relatively) 
> slow on large data sets, since it is O(n**2).

I made little test and it is fast enough for my purpose. :-)

> Since you know that item 2 is not empty, you must also know that the whole 
> line is not empty :-),
> so you can simply check for that.
> 
> put empty into Array
> repeat for each line tLine in tData
>  put item 2 of tLine into tKey
>  if tKey = EMPTY then next repeat
> # if tArray[tKey] is EMPTY then
>     put tLine & CR after tArray[tKey]   -- or would 'into' be even faster 
> than 'after' ??

## I need AFTER, since I want to collect all lines with the same item 2 in that 
key.
## So no need for this IF clause in my case.

> # end if
> end repeat
> 
> Alex.

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major-k.de


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to