From 35224d5e7f3e0c978640b7a6dd64e9778c4d1c60 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 20 Aug 2015 16:44:44 -0700 Subject: [PATCH] Memoize address_regex locally. --- lib/gitlab/reply_by_email.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/reply_by_email.rb b/lib/gitlab/reply_by_email.rb index f93fda4302c..c3fe6778f06 100644 --- a/lib/gitlab/reply_by_email.rb +++ b/lib/gitlab/reply_by_email.rb @@ -21,9 +21,10 @@ module Gitlab end def reply_key_from_address(address) - return unless address_regex + regex = address_regex + return unless regex - match = address.match(address_regex) + match = address.match(regex) return unless match match[1]