Skip to content

ENH: Initialize variables in smallest scope#5023

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
hjmjohnson:initialize-variables-in-small-scope
Dec 9, 2024
Merged

ENH: Initialize variables in smallest scope#5023
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
hjmjohnson:initialize-variables-in-small-scope

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

Changes for preferring initialization to assignment.

This involved moving variable initialization to
the smallest possible scope.

The more locally scoped variables allow for future
automated code refactorings.

PR Checklist

@hjmjohnson hjmjohnson added the type:Style Style changes: no logic impact (indentation, comments, naming) label Dec 8, 2024
@hjmjohnson hjmjohnson added this to the ITK 6.0 Beta 1 milestone Dec 8, 2024
@hjmjohnson hjmjohnson self-assigned this Dec 8, 2024
@hjmjohnson hjmjohnson force-pushed the initialize-variables-in-small-scope branch from 73fa187 to 7d908e9 Compare December 8, 2024 21:12
@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation area:Examples Demonstration of the use of classes area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module area:Numerics Issues affecting the Numerics module and removed type:Style Style changes: no logic impact (indentation, comments, naming) labels Dec 8, 2024
This involved moving variable initialization to
the smallest possible scope.

The more locally scoped variables allow for future
automated code refactorings.
@hjmjohnson hjmjohnson merged commit db46bb2 into InsightSoftwareConsortium:master Dec 9, 2024
@hjmjohnson hjmjohnson deleted the initialize-variables-in-small-scope branch December 9, 2024 17:06
@hjmjohnson hjmjohnson restored the initialize-variables-in-small-scope branch February 4, 2025 23:21
@hjmjohnson hjmjohnson deleted the initialize-variables-in-small-scope branch June 24, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Examples Demonstration of the use of classes area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Numerics Issues affecting the Numerics module area:Python wrapping Python bindings for a class area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module type:Enhancement Improvement of existing methods or implementation type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants