Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ranged loop type in SdfLayer #2350

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

nvmkuruc
Copy link
Collaborator

@nvmkuruc nvmkuruc commented Mar 22, 2023

Description of Change(s)

When building with GCC11, the following warning was observed.

 warning: loop variable ‘tokenPath’ of type ‘const std::pair<pxrInternal_v0_23__pxrReserved__::TfToken, pxrInternal_v0_23__pxrReserved__::SdfPath>&’ binds to a temporary constructed from type ‘std::pair<const pxrInternal_v0_23__pxrReserved__::TfToken, pxrInternal_v0_23__pxrReserved__::SdfPath>’ [-Wrange-loop-construct]

The value type of a std::map<TfToken, SdfPath> is std::pair<const TfToken, SdfPath> not std::pair<TfToken, SdfPath>. This change uses auto in the range loop to avoid the unnecessary temporary copy.

Fixes Issue(s)

N/A

  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@tallytalwar
Copy link
Contributor

Filed as internal issue #USD-8137

@pixar-oss pixar-oss merged commit cc3cba5 into PixarAnimationStudios:dev Aug 4, 2023
@nvmkuruc nvmkuruc deleted the sdflayerloop branch December 29, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants