Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fc06882c
Commit
fc06882c
authored
Feb 05, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove BisectEnumerable
parent
d1c3d4b5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
22 deletions
+1
-22
lib/gitlab/background_migration/migrate_uploads_to_object_storage.rb
...background_migration/migrate_uploads_to_object_storage.rb
+1
-1
lib/gitlab/utils.rb
lib/gitlab/utils.rb
+0
-2
lib/gitlab/utils/bisect_enumerable.rb
lib/gitlab/utils/bisect_enumerable.rb
+0
-19
No files found.
lib/gitlab/background_migration/migrate_uploads_to_object_storage.rb
View file @
fc06882c
...
...
@@ -105,7 +105,7 @@ module Gitlab
module
Report
def
report
(
results
)
success
,
failures
=
Gitlab
::
Utils
::
BisectEnumerable
.
bisect
(
results
,
&
:success?
)
success
,
failures
=
results
.
partition
(
&
:success?
)
Rails
.
logger
.
info
header
(
success
,
failures
)
Rails
.
logger
.
warn
failures
(
failures
)
...
...
lib/gitlab/utils.rb
View file @
fc06882c
module
Gitlab
module
Utils
include
BisectEnumerable
extend
self
# Run system command without outputting to stdout.
...
...
lib/gitlab/utils/bisect_enumerable.rb
deleted
100644 → 0
View file @
d1c3d4b5
module
Gitlab
module
Utils
module
BisectEnumerable
extend
self
# Bisect an enumerable by using &block as pivot.
# Return two arrays, depending on the result of the pivot.
# [e] -> [[e]: pivot(e) == true, [e]: pivot(e) == false]
#
# Example: odd, even = bisect((1..10), &:odd?)
def
bisect
(
enumerable
,
&
block
)
return
[[],
[]]
unless
enumerable
.
any?
bisect
=
enumerable
.
group_by
(
&
block
)
[
bisect
.
fetch
(
true
,
[]),
bisect
.
fetch
(
false
,
[])]
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