Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 33111b2a7728
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9365b251ad45
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 4, 2016

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a009934 View commit details

Commits on Sep 5, 2016

  1. Merge pull request #3247 from grosser/grosser/fast-string

    OptionParser: make flag addition code simpler and faster
    Ary Borenszweig authored Sep 5, 2016
    Copy the full SHA
    9365b25 View commit details
Showing with 1 addition and 8 deletions.
  1. +1 −8 src/option_parser.cr
9 changes: 1 addition & 8 deletions src/option_parser.cr
Original file line number Diff line number Diff line change
@@ -146,14 +146,7 @@ class OptionParser
end

private def append_flag(flag, description)
@flags << String.build do |str|
str << " "
str << flag
(33 - flag.size).times do
str << " "
end
str << description
end
@flags << " #{flag}#{" " * (33 - flag.size)}#{description}"
end

# Parses the passed *args*, running the handlers associated to each option.