]> source.dussan.org Git - sonarqube.git/commitdiff
Shorter code
authorDavid Gageot <david@gageot.net>
Sat, 29 Sep 2012 12:15:21 +0000 (14:15 +0200)
committerDavid Gageot <david@gageot.net>
Mon, 1 Oct 2012 06:46:47 +0000 (08:46 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/api/utils.rb

index 81e74632ca9fae889d762a26ed45ede33593b5fa..56735bef90eb2c1d0935f9bdbac4b8d938e25104 100644 (file)
@@ -46,12 +46,10 @@ class Api::Utils
   end
 
   def self.is_regexp?(s)
-    begin
-      Regexp.new(s)
-      true
-    rescue
-      false
-    end
+    Regexp.new(s)
+    true
+  rescue
+    false
   end
 
   def self.markdown_to_html(markdown)