|
Result of the 2nd Refactoring |
Top Previous Next |
|
Now we've got:
Now, just because we can't help noticing certain things, it seems clear that we can consolidate the last few lines pretty neatly by eliminating ans, so we'll just do that by hand (for now), leaving us with
lastWord = lastDelimitedStringBeforePosition(sourceStr, delimiters, i)
(By the way, this is a "manual implementation" of the refactoring known as inline temp).
Then, finally, we decide that i isn't a good enough name for a variable, so we do a search-and-replace to change it into stringIndex |