Skip to content

Instantly share code, notes, and snippets.

@dwbuiten
Created June 24, 2014 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwbuiten/de4395befbbe745800c7 to your computer and use it in GitHub Desktop.
Save dwbuiten/de4395befbbe745800c7 to your computer and use it in GitHub Desktop.
switch idiom
switch mystr {
case "a", "b", "c", "d", "e":
default:
dostuff()
}
// versus
if myster != "a" && mystr != "=" && mystr != "c" && mystr != "d" && mystr != "e" {
dostuff()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment