diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2018-09-18 12:36:24 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2018-09-18 14:31:17 +0500 |
commit | def3ab29719846758cef8f1e1a5cb5f88320bc48 (patch) | |
tree | e2194241f1b1af38aa80392598d78ef01871c4b2 /app/models/network | |
parent | 953018e3d4b0bc101543218f4cdf235e1a9d51c8 (diff) | |
download | gitlab-ce-def3ab29719846758cef8f1e1a5cb5f88320bc48.tar.gz |
Fix rubocop Style/ZeroLengthPredicate
Diffstat (limited to 'app/models/network')
-rw-r--r-- | app/models/network/commit.rb | 2 | ||||
-rw-r--r-- | app/models/network/graph.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/network/commit.rb b/app/models/network/commit.rb index 6c5a4c56377..1b2369aab18 100644 --- a/app/models/network/commit.rb +++ b/app/models/network/commit.rb @@ -18,7 +18,7 @@ module Network end def space - if @spaces.size > 0 + if @spaces.present? @spaces.first else 0 diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb index 1431dfefc55..6da3bb7bfb7 100644 --- a/app/models/network/graph.rb +++ b/app/models/network/graph.rb @@ -81,7 +81,7 @@ module Network skip = 0 while offset == -1 tmp_commits = find_commits(skip) - if tmp_commits.size > 0 + if tmp_commits.present? index = tmp_commits.index do |c| c.id == @commit.id end @@ -218,7 +218,7 @@ module Network def get_space_base(leaves) space_base = 1 parents = leaves.last.parents(@map) - if parents.size > 0 + if parents.present? if parents.first.space > 0 space_base = parents.first.space end |