From 4084b2b62be8ca15c4263ea5a53c945380bbb424 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Tue, 9 Nov 2010 16:57:38 +0000 Subject: tidy up regex for compressible_att_type git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1033093 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_util.erl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_util.erl b/src/couchdb/couch_util.erl index da3bf511..c11ba994 100644 --- a/src/couchdb/couch_util.erl +++ b/src/couchdb/couch_util.erl @@ -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 /= []] ). -- cgit v1.2.3