From 1cd7fd3867acabeb29196da4cf505a0eb703b287 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 8 Jun 2015 02:23:57 -0400 Subject: [PATCH] 6203: Use faster =~ instead of match. --- services/api/app/models/blob.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/api/app/models/blob.rb b/services/api/app/models/blob.rb index 56cdfb83a4..34600d7a25 100644 --- a/services/api/app/models/blob.rb +++ b/services/api/app/models/blob.rb @@ -90,7 +90,7 @@ class Blob if !timestamp raise Blob::InvalidSignatureError.new 'No signature provided.' end - if !timestamp.match /^[\da-f]+$/ + unless timestamp =~ /^[\da-f]+$/ raise Blob::InvalidSignatureError.new 'Timestamp is not a base16 number.' end if timestamp.to_i(16) < (opts[:now] or db_current_time.to_i) -- 2.30.2