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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
path_list.rb
lib/cocoapods/sandbox/path_list.rb
+8
-6
No files found.
lib/cocoapods/sandbox/path_list.rb
View file @
53444c28
...
@@ -128,19 +128,21 @@ module Pod
...
@@ -128,19 +128,21 @@ module Pod
else
else
full_list
=
files
full_list
=
files
end
end
patterns_array
=
Array
(
patterns
)
list
=
Array
(
patterns
).
map
do
|
pattern
|
exact_matches
=
full_list
&
patterns_array
patterns_array
-=
exact_matches
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?
(
'/'
)
pattern
+=
dir_pattern
pattern
+=
dir_pattern
end
end
expanded_patterns
=
dir_glob_equivalent_patterns
(
pattern
)
dir_glob_equivalent_patterns
(
pattern
)
full_list
.
select
do
|
path
|
end
.
flatten
expanded_patterns
.
any?
do
|
p
|
list
=
exact_matches
+
full_list
.
select
do
|
path
|
all_patterns
.
any?
do
|
p
|
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
File
.
fnmatch
(
p
,
path
,
File
::
FNM_CASEFOLD
|
File
::
FNM_PATHNAME
)
end
end
end
end
end
.
flatten
list
=
list
.
map
{
|
path
|
Pathname
.
new
(
path
)
}
list
=
list
.
map
{
|
path
|
Pathname
.
new
(
path
)
}
if
exclude_patterns
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