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

make LookupEnv use cached v parameter #280

Merged
merged 2 commits into from
Feb 14, 2024
Merged

make LookupEnv use cached v parameter #280

merged 2 commits into from
Feb 14, 2024

Conversation

lock14
Copy link
Contributor

@lock14 lock14 commented Feb 14, 2024

No description provided.

@lock14 lock14 requested a review from sethvargo February 14, 2024 19:28
@lock14 lock14 requested a review from a team as a code owner February 14, 2024 19:28
sailorlqh
sailorlqh previously approved these changes Feb 14, 2024
Copy link
Contributor

@sethvargo sethvargo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually intentional; we don't lock, so we want to create the local allocation in case the underlying variables changes beneath us. You cannot guarantee that the c.stdout on L1 is the same c.stdout that you return.

@pdewilde pdewilde closed this Feb 14, 2024
@pdewilde
Copy link
Contributor

Oops, that wasn't the "delete draft button"

@lock14
Copy link
Contributor Author

lock14 commented Feb 14, 2024

This is actually intentional; we don't lock, so we want to create the local allocation in case the underlying variables changes beneath us. You cannot guarantee that the c.stdout on L1 is the same c.stdout that you return.

I see, that makes sense. Shouldn't LookupEnv method also use the v parameter then? I've updated the code to do this.

@lock14 lock14 changed the title remove unneeded assignments make LookupEnv use cached v parameter Feb 14, 2024
@lock14 lock14 changed the title make LookupEnv use cached v parameter make LookupEnv use cached v parameter Feb 14, 2024
@lock14 lock14 requested a review from sethvargo February 14, 2024 20:45
@lock14 lock14 merged commit a8d1a3e into main Feb 14, 2024
2 checks passed
@lock14 lock14 deleted the bbechtel/cleanup branch February 14, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants