Commit 5137fce2 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Return early if there were no references in text

parent 118d1240
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment