Freeze regexp and add a comment

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8620#note_21590440
This commit is contained in:
Lin Jen-Shin 2017-02-03 17:37:06 +08:00
parent 849d09cfd6
commit 2f80cbb675

View file

@ -35,12 +35,14 @@ module Gitlab
end
def key_from_fallback_message_id(mail_id)
message_id_regexp = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\z/
message_id_regexp =
/\Areply\-(.+)@#{Gitlab.config.gitlab.host}\z/.freeze
mail_id[message_id_regexp, 1]
end
def scan_fallback_references(references)
# It's looking for each <...>
references.scan(/(?!<)[^<>]+(?=>)/.freeze)
end