Remove useless lines caused by declaration-after-statement warning #266
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is done using the same automated technique introduced for the Citus
repo in citusdata/citus#3181. The main idea is
to replace:
with:
For details of how this works see the above mentioned Citus PR.
This comment about not doing early an early return to limit the scope of
variables caused me to add this here too:
#244 (comment)
With this commit merged, scope of variables will always be minimal in
cases where an early return is possible.
To make sure merge conflict handling is easy the following steps should be done:
by doing
git checkout --theirs src
to ignore the changes caused by this PR.Then running
ci/remove_useless_declarations.sh
will redo all the changes.To further limit impact, this PR can be merged right before a release, to make
sure most open PRs have been merged. This PR can be trivially updated as well by doing: