Skip to content

Be explicit about capturing the pointer#10765

Merged
rohit-nayak-ps merged 2 commits intovitessio:mainfrom
planetscale:dbussink/avoid-linter-loop-error
Jul 20, 2022
Merged

Be explicit about capturing the pointer#10765
rohit-nayak-ps merged 2 commits intovitessio:mainfrom
planetscale:dbussink/avoid-linter-loop-error

Conversation

@dbussink
Copy link
Member

The logic here was accidentally correct since we always in practice grab the pointer only on the last iteration, so it works.

But the loop pointer linter catches this as an issue which is a good thing. Let's make it explicit how we capture this variable so there's no confusion and the linter also is happy about it.

Related Issue(s)

This is the only other case the new linter alerts on in the codebase it looks apart from the bug fix that is in progress in #10739

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation was added or is not required

dbussink added 2 commits July 20, 2022 13:01
The logic here was accidentally correct since we always in practice grab
the pointer only on the last iteration, so it works.

But the loop pointer linter catches this as an issue which is a good
thing. Let's make it explicit how we capture this variable so there's no
confusion and the linter also is happy about it.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
@dbussink dbussink force-pushed the dbussink/avoid-linter-loop-error branch from 413258f to 60f4bfb Compare July 20, 2022 11:04
@dbussink dbussink requested a review from frouioui as a code owner July 20, 2022 11:04
@rohit-nayak-ps rohit-nayak-ps merged commit 8331226 into vitessio:main Jul 20, 2022
@rohit-nayak-ps rohit-nayak-ps deleted the dbussink/avoid-linter-loop-error branch July 20, 2022 15:48
@deepthi deepthi mentioned this pull request Jul 30, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants