Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
c30bb72c
Commit
c30bb72c
authored
Mar 05, 2018
by
Muhammed Yavuz Nuzumlalı
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PathList] Get rid of unnecessary traversal with empty patterns
parent
1bae2834
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
path_list.rb
lib/cocoapods/sandbox/path_list.rb
+7
-3
No files found.
lib/cocoapods/sandbox/path_list.rb
View file @
c30bb72c
...
@@ -131,6 +131,7 @@ module Pod
...
@@ -131,6 +131,7 @@ module Pod
patterns_array
=
Array
(
patterns
)
patterns_array
=
Array
(
patterns
)
exact_matches
=
full_list
&
patterns_array
exact_matches
=
full_list
&
patterns_array
patterns_array
-=
exact_matches
patterns_array
-=
exact_matches
all_patterns
=
patterns_array
.
map
do
|
pattern
|
all_patterns
=
patterns_array
.
map
do
|
pattern
|
if
directory?
(
pattern
)
&&
dir_pattern
if
directory?
(
pattern
)
&&
dir_pattern
pattern
+=
'/'
unless
pattern
.
end_with?
(
'/'
)
pattern
+=
'/'
unless
pattern
.
end_with?
(
'/'
)
...
@@ -138,9 +139,12 @@ module Pod
...
@@ -138,9 +139,12 @@ module Pod
end
end
dir_glob_equivalent_patterns
(
pattern
)
dir_glob_equivalent_patterns
(
pattern
)
end
.
flatten
end
.
flatten
list
=
exact_matches
+
full_list
.
select
do
|
path
|
list
=
exact_matches
all_patterns
.
any?
do
|
p
|
unless
all_patterns
.
empty?
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
list
+=
full_list
.
select
do
|
path
|
all_patterns
.
any?
do
|
p
|
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment