Changing array key text
Brian Milby
brian at milby7.com
Mon Jun 24 22:18:20 EDT 2019
My guess is that it has to do with the copy on write property of arrays. If you used your method it may force an actual duplication. The existing method just passes a pointer effectively. I could be totally wrong though.
Thanks,
Brian
On Jun 24, 2019, 10:11 PM -0400, Mark Wieder via use-livecode <use-livecode at lists.runrev.com>, wrote:
> On 6/24/19 7:00 PM, Brian Milby via use-livecode wrote:
> > Close, here's the actual code (part of setArrayKeyOnPath):
> >
> > put xArray[item 1 of pPath] into tSubArray
> > delete variable xArray[item 1 of pPath]
> > put tSubArray into xArray[pKey]
>
> Interesting. Wouldn't it be faster to do
>
> put xArray[item 1 of pPath] into xArray[pKey]
> delete variable xArray[item 1 of pPath]
>
> i.e., why the extra copy?
>
> --
> Mark Wieder
> ahsoftware at gmail.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list