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
53444c28
Commit
53444c28
authored
Feb 22, 2018
by
Muhammed Yavuz Nuzumlalı
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PathList] Use set and intersect to speed up exact matches
parent
d60ff0ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
path_list.rb
lib/cocoapods/sandbox/path_list.rb
+10
-8
No files found.
lib/cocoapods/sandbox/path_list.rb
View file @
53444c28
...
...
@@ -128,19 +128,21 @@ module Pod
else
full_list
=
files
end
list
=
Array
(
patterns
).
map
do
|
pattern
|
patterns_array
=
Array
(
patterns
)
exact_matches
=
full_list
&
patterns_array
patterns_array
-=
exact_matches
all_patterns
=
patterns_array
.
map
do
|
pattern
|
if
directory?
(
pattern
)
&&
dir_pattern
pattern
+=
'/'
unless
pattern
.
end_with?
(
'/'
)
pattern
+=
dir_pattern
end
expanded_patterns
=
dir_glob_equivalent_patterns
(
pattern
)
full_list
.
select
do
|
path
|
expanded_patterns
.
any?
do
|
p
|
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
end
end
dir_glob_equivalent_patterns
(
pattern
)
end
.
flatten
list
=
exact_matches
+
full_list
.
select
do
|
path
|
all_patterns
.
any?
do
|
p
|
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
end
end
list
=
list
.
map
{
|
path
|
Pathname
.
new
(
path
)
}
if
exclude_patterns
...
...
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