Copy link to clipboard
Copied
Hello! Tell me, who knows and can explain, than differ:
local photos = catalog.targetPhotos --table: 000000024BB4D970
local selectedPhotos = catalog:getTargetPhotos () --table: 000000025491B8F0
The object has the same photos, but the table IDs are different. I can not understand the difference, and what in what case to use...
Internally, catalog.targetPhotos gets translated to catalog:getTargetPhotos(), so they're equivalent. Every time you evaluate catalog:getTargetPhotos(), a new table is constructed and returned. catalog.targetPhotos is about half as fast as catalog:getTargetPhotos() because of the internal steps taken to translate it to catalog:getTargetPhotos(). (But we're talking on the order of 12 usecs versus 6, not likely to make a difference in practice.)
[Use the reply button under the first post to e
...Copy link to clipboard
Copied
Internally, catalog.targetPhotos gets translated to catalog:getTargetPhotos(), so they're equivalent. Every time you evaluate catalog:getTargetPhotos(), a new table is constructed and returned. catalog.targetPhotos is about half as fast as catalog:getTargetPhotos() because of the internal steps taken to translate it to catalog:getTargetPhotos(). (But we're talking on the order of 12 usecs versus 6, not likely to make a difference in practice.)
[Use the reply button under the first post to ensure replies sort properly.]
Copy link to clipboard
Copied
Thanks!))