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 <[email protected]>, 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 > [email protected] > > _______________________________________________ > use-livecode mailing list > [email protected] > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
