Skip to content

Commit

Permalink
simplify split variable
Browse files Browse the repository at this point in the history
  • Loading branch information
emilybache committed Feb 3, 2025
1 parent e4dada6 commit 2264421
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions _refactorings/split_variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ Steps for each of the three situations:
2. An accumulating variable
* Tests all passing
* Identify a variable that needs to be split, 'x'
* Create a new local variable 'initial_x' and initialize it to 'x'
* Create a new local variable 'increment_x' and initialize it to an empty value eg zero
* Within the lines of code you select use textual search and replace - rename 'x' to 'increment_x'
* After those lines, re-assign x = initial_x + increment_x
* After those lines, re-assign x += increment_x
* Tests all passing

3. A global or class variable
Expand Down

0 comments on commit 2264421

Please sign in to comment.