Skip to content

LearnWithLlew/EarlyReturnKata.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EarlyReturnKata

Step:

  1. Add return
     Return<type> r;
  1. Move value into return
r.set(value);
return r.value;
  1. Add if clause
if (r.isSet) {
    return r.value;
} else {

}
  1. move up a level
    a. if you are in a loop, duplicate outside and add a break;
  2. expand else to everything in left in current block
  3. invert if
  4. repeat

About

Kata for refactoring early returns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published