diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-03-13 09:41:00 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-03-13 09:50:40 +0100 |
commit | 5137fce2fd4fc739e2ab1d8c61dc8b72eda7c353 (patch) | |
tree | e3614fa0634339c8c22efe9d6d6c5463d0e00fca /lib | |
parent | 118d12405a8ed1e8251c74a08044e47cd17998c2 (diff) | |
download | gitlab-ce-5137fce2fd4fc739e2ab1d8c61dc8b72eda7c353.tar.gz |
Return early if there were no references in text
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/user_extractor.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/gitlab/user_extractor.rb b/lib/gitlab/user_extractor.rb index 076781fdd96..b41d085ee77 100644 --- a/lib/gitlab/user_extractor.rb +++ b/lib/gitlab/user_extractor.rb @@ -16,12 +16,9 @@ module Gitlab def users return User.none unless @text.present? + return User.none if references.empty? - relations = union_relations - - return User.none unless relations.any? - - @users ||= User.from_union(relations) + @users ||= User.from_union(union_relations) end def usernames |