• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

catalog.targetPhotos OR catalog:getTargetPhotos ()

Participant ,
Nov 28, 2019 Nov 28, 2019

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...

Views

297

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 28, 2019 Nov 28, 2019

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

...

Votes

Translate

Translate
LEGEND ,
Nov 28, 2019 Nov 28, 2019

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.]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 28, 2019 Nov 28, 2019

Copy link to clipboard

Copied

LATEST

Thanks!))

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines