couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r1033093 - /couchdb/trunk/src/couchdb/couch_util.erl
Date Tue, 09 Nov 2010 16:57:38 GMT
Author: kocolosk
Date: Tue Nov  9 16:57:38 2010
New Revision: 1033093

URL: http://svn.apache.org/viewvc?rev=1033093&view=rev
Log:
tidy up regex for compressible_att_type

Modified:
    couchdb/trunk/src/couchdb/couch_util.erl

Modified: couchdb/trunk/src/couchdb/couch_util.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_util.erl?rev=1033093&r1=1033092&r2=1033093&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_util.erl (original)
+++ couchdb/trunk/src/couchdb/couch_util.erl Tue Nov  9 16:57:38 2010
@@ -398,14 +398,8 @@ compressible_att_type(MimeType) ->
     ),
     lists:any(
         fun(TypeExp) ->
-            Regexp = "^\\s*" ++
-                re:replace(TypeExp, "\\*", ".*", [{return, list}]) ++ "\\s*$",
-            case re:run(MimeType, Regexp, [caseless]) of
-            {match, _} ->
-                true;
-            _ ->
-                false
-            end
+            Regexp = ["^\\s*", re:replace(TypeExp, "\\*", ".*"), "\\s*$"],
+            re:run(MimeType, Regexp, [caseless]) =/= nomatch
         end,
         [T || T <- TypeExpList, T /= []]
     ).



Mime
View raw message