Refactoring
An Introduction |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
// Original Code
if ( 0 <= (b*b - 4*a*c)) { ... }
// Refactored Code
boolean hasRoots = ( 0 <= (b*b - 4*a*c));
if (hasRoots) { ... }