Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
13b1e4fe
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
13b1e4fe
编写于
3月 17, 2017
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dm-use-index-by' into 'master'
Use Enumerable#index_by where possible See merge request !10011
上级
e5dfcdf2
871bed7a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
5 addition
and
20 deletion
+5
-20
app/services/merge_requests/get_urls_service.rb
app/services/merge_requests/get_urls_service.rb
+1
-4
app/services/users/refresh_authorized_projects_service.rb
app/services/users/refresh_authorized_projects_service.rb
+1
-3
lib/banzai/filter/abstract_reference_filter.rb
lib/banzai/filter/abstract_reference_filter.rb
+1
-6
lib/banzai/filter/user_reference_filter.rb
lib/banzai/filter/user_reference_filter.rb
+1
-4
lib/banzai/reference_parser/base_parser.rb
lib/banzai/reference_parser/base_parser.rb
+1
-3
未找到文件。
app/services/merge_requests/get_urls_service.rb
浏览文件 @
13b1e4fe
...
...
@@ -23,10 +23,7 @@ module MergeRequests
def
opened_merge_requests_from_source_branches
(
branches
)
merge_requests
=
MergeRequest
.
from_project
(
project
).
opened
.
from_source_branches
(
branches
)
merge_requests
.
inject
({})
do
|
hash
,
mr
|
hash
[
mr
.
source_branch
]
=
mr
hash
end
merge_requests
.
index_by
(
&
:source_branch
)
end
def
get_branches
(
changes
)
...
...
app/services/users/refresh_authorized_projects_service.rb
浏览文件 @
13b1e4fe
...
...
@@ -93,9 +93,7 @@ module Users
end
def
current_authorizations_per_project
current_authorizations
.
each_with_object
({})
do
|
row
,
hash
|
hash
[
row
.
project_id
]
=
row
end
current_authorizations
.
index_by
(
&
:project_id
)
end
def
current_authorizations
...
...
lib/banzai/filter/abstract_reference_filter.rb
浏览文件 @
13b1e4fe
...
...
@@ -239,18 +239,13 @@ module Banzai
# path.
def
projects_per_reference
@projects_per_reference
||=
begin
hash
=
{}
refs
=
Set
.
new
references_per_project
.
each
do
|
project_ref
,
_
|
refs
<<
project_ref
end
find_projects_for_paths
(
refs
.
to_a
).
each
do
|
project
|
hash
[
project
.
path_with_namespace
]
=
project
end
hash
find_projects_for_paths
(
refs
.
to_a
).
index_by
(
&
:full_path
)
end
end
...
...
lib/banzai/filter/user_reference_filter.rb
浏览文件 @
13b1e4fe
...
...
@@ -74,10 +74,7 @@ module Banzai
# The keys of this Hash are the namespace paths, the values the
# corresponding Namespace objects.
def
namespaces
@namespaces
||=
Namespace
.
where_full_path_in
(
usernames
).
each_with_object
({})
do
|
row
,
hash
|
hash
[
row
.
full_path
]
=
row
end
@namespaces
||=
Namespace
.
where_full_path_in
(
usernames
).
index_by
(
&
:full_path
)
end
# Returns all usernames referenced in the current document.
...
...
lib/banzai/reference_parser/base_parser.rb
浏览文件 @
13b1e4fe
...
...
@@ -134,9 +134,7 @@ module Banzai
ids
=
unique_attribute_values
(
nodes
,
attribute
)
rows
=
collection_objects_for_ids
(
collection
,
ids
)
rows
.
each_with_object
({})
do
|
row
,
hash
|
hash
[
row
.
id
]
=
row
end
rows
.
index_by
(
&
:id
)
end
# Returns an Array containing all unique values of an attribute of the
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录