Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
5bf652ec
Commit
5bf652ec
authored
11 years ago
by
Jack Nagel
Browse files
Options
Downloads
Patches
Plain Diff
Avoid extra array allocations
parent
b3220203
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/options.rb
+9
-6
9 additions, 6 deletions
Library/Homebrew/options.rb
Library/Homebrew/version.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/version.rb
with
10 additions
and
7 deletions
Library/Homebrew/options.rb
+
9
−
6
View file @
5bf652ec
...
...
@@ -106,13 +106,16 @@ class Options
when
self
then
arg
when
Option
then
new
<<
arg
when
Array
opts
=
arg
.
map
do
|
_arg
|
case
_arg
when
/^-[^-]+$/
then
_arg
[
1
..-
1
].
split
(
//
)
else
_arg
opts
=
new
arg
.
each
do
|
a
|
case
a
when
/^-[^-]+$/
a
[
1
..-
1
].
split
(
//
).
each
{
|
o
|
opts
<<
Option
.
new
(
o
)
}
else
opts
<<
Option
.
new
(
a
)
end
end
.
flatten
new
(
opts
.
map
{
|
o
|
Option
.
new
(
o
)
})
end
opts
else
raise
TypeError
,
"Cannot convert
#{
arg
.
inspect
}
to Options"
end
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/version.rb
+
1
−
1
View file @
5bf652ec
...
...
@@ -97,7 +97,7 @@ class Version
protected
def
to_a
@array
||=
@version
.
scan
(
/\d+|[a-zA-Z]+/
).
map
{
|
e
|
VersionElement
.
new
(
e
)
}
@array
||=
@version
.
scan
(
/\d+|[a-zA-Z]+/
).
map
!
{
|
e
|
VersionElement
.
new
(
e
)
}
end
def
self
.
parse
spec
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment