Created
April 4, 2011 17:13
-
-
Save ymek/901997 to your computer and use it in GitHub Desktop.
Consolidation is legibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### | |
| # We can change C-style if-statements to something more legible in Ruby | |
| # though it's likely a few cycles less efficient | |
| ### | |
| # From this... | |
| if @project_name == 'cowbell' or @project_name == 'aquarium' or @project_name == 'weblib' or @project_name == 'tinysong' or @project_name == 'conf' or @project_name == 'html5' or @project_name == 'conf' | |
| # do something... | |
| end | |
| # To this... | |
| if %w{ cowbell aquarium weblib tinysong conf html5 conf }.include? @project_name | |
| # do somethings... | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment