From 404aefb052d6671c08017347273debf67123bfa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 7 Jan 2015 12:48:23 +0100 Subject: Use 'or' instead of 'orelse' in cow_http_hd About the same except for functions with tons of tests per clauses, like parse_content_language/1. --- include/cow_parse.hrl | 74 +++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'include') diff --git a/include/cow_parse.hrl b/include/cow_parse.hrl index 1ec3dcb..5bbf8a3 100644 --- a/include/cow_parse.hrl +++ b/include/cow_parse.hrl @@ -16,64 +16,64 @@ -define(COW_PARSE_HRL, 1). -define(IS_ALPHA(C), - C =:= $a orelse C =:= $b orelse C =:= $c orelse C =:= $d orelse C =:= $e orelse - C =:= $f orelse C =:= $g orelse C =:= $h orelse C =:= $i orelse C =:= $j orelse - C =:= $k orelse C =:= $l orelse C =:= $m orelse C =:= $n orelse C =:= $o orelse - C =:= $p orelse C =:= $q orelse C =:= $r orelse C =:= $s orelse C =:= $t orelse - C =:= $u orelse C =:= $v orelse C =:= $w orelse C =:= $x orelse C =:= $y orelse - C =:= $z orelse - C =:= $A orelse C =:= $B orelse C =:= $C orelse C =:= $D orelse C =:= $E orelse - C =:= $F orelse C =:= $G orelse C =:= $H orelse C =:= $I orelse C =:= $J orelse - C =:= $K orelse C =:= $L orelse C =:= $M orelse C =:= $N orelse C =:= $O orelse - C =:= $P orelse C =:= $Q orelse C =:= $R orelse C =:= $S orelse C =:= $T orelse - C =:= $U orelse C =:= $V orelse C =:= $W orelse C =:= $X orelse C =:= $Y orelse - C =:= $Z + (C =:= $a) or (C =:= $b) or (C =:= $c) or (C =:= $d) or (C =:= $e) or + (C =:= $f) or (C =:= $g) or (C =:= $h) or (C =:= $i) or (C =:= $j) or + (C =:= $k) or (C =:= $l) or (C =:= $m) or (C =:= $n) or (C =:= $o) or + (C =:= $p) or (C =:= $q) or (C =:= $r) or (C =:= $s) or (C =:= $t) or + (C =:= $u) or (C =:= $v) or (C =:= $w) or (C =:= $x) or (C =:= $y) or + (C =:= $z) or + (C =:= $A) or (C =:= $B) or (C =:= $C) or (C =:= $D) or (C =:= $E) or + (C =:= $F) or (C =:= $G) or (C =:= $H) or (C =:= $I) or (C =:= $J) or + (C =:= $K) or (C =:= $L) or (C =:= $M) or (C =:= $N) or (C =:= $O) or + (C =:= $P) or (C =:= $Q) or (C =:= $R) or (C =:= $S) or (C =:= $T) or + (C =:= $U) or (C =:= $V) or (C =:= $W) or (C =:= $X) or (C =:= $Y) or + (C =:= $Z) ). --define(IS_ALPHANUM(C), ?IS_ALPHA(C) orelse ?IS_DIGIT(C)). +-define(IS_ALPHANUM(C), ?IS_ALPHA(C) or ?IS_DIGIT(C)). -define(IS_CHAR(C), C > 0, C < 128). -define(IS_DIGIT(C), - C =:= $0 orelse C =:= $1 orelse C =:= $2 orelse C =:= $3 orelse C =:= $4 orelse - C =:= $5 orelse C =:= $6 orelse C =:= $7 orelse C =:= $8 orelse C =:= $9). + (C =:= $0) or (C =:= $1) or (C =:= $2) or (C =:= $3) or (C =:= $4) or + (C =:= $5) or (C =:= $6) or (C =:= $7) or (C =:= $8) or (C =:= $9)). -define(IS_ETAGC(C), C =:= 16#21; C >= 16#23, C =/= 16#7f). -define(IS_HEX(C), - ?IS_DIGIT(C) orelse - C =:= $a orelse C =:= $b orelse C =:= $c orelse - C =:= $d orelse C =:= $e orelse C =:= $f orelse - C =:= $A orelse C =:= $B orelse C =:= $C orelse - C =:= $D orelse C =:= $E orelse C =:= $F). + ?IS_DIGIT(C) or + (C =:= $a) or (C =:= $b) or (C =:= $c) or + (C =:= $d) or (C =:= $e) or (C =:= $f) or + (C =:= $A) or (C =:= $B) or (C =:= $C) or + (C =:= $D) or (C =:= $E) or (C =:= $F)). -define(IS_LHEX(C), - ?IS_DIGIT(C) orelse - C =:= $a orelse C =:= $b orelse C =:= $c orelse - C =:= $d orelse C =:= $e orelse C =:= $f). + ?IS_DIGIT(C) or + (C =:= $a) or (C =:= $b) or (C =:= $c) or + (C =:= $d) or (C =:= $e) or (C =:= $f)). -define(IS_TOKEN(C), - ?IS_ALPHA(C) orelse ?IS_DIGIT(C) - orelse C =:= $! orelse C =:= $# orelse C =:= $$ orelse C =:= $% orelse C =:= $& - orelse C =:= $' orelse C =:= $* orelse C =:= $+ orelse C =:= $- orelse C =:= $. - orelse C =:= $^ orelse C =:= $_ orelse C =:= $` orelse C =:= $| orelse C =:= $~). + ?IS_ALPHA(C) or ?IS_DIGIT(C) or + (C =:= $!) or (C =:= $#) or (C =:= $$) or (C =:= $%) or (C =:= $&) or + (C =:= $') or (C =:= $*) or (C =:= $+) or (C =:= $-) or (C =:= $.) or + (C =:= $^) or (C =:= $_) or (C =:= $`) or (C =:= $|) or (C =:= $~)). -define(IS_TOKEN68(C), - ?IS_ALPHA(C) orelse ?IS_DIGIT(C) orelse - C =:= $- orelse C =:= $. orelse C =:= $_ orelse - C =:= $~ orelse C =:= $+ orelse C =:= $/). + ?IS_ALPHA(C) or ?IS_DIGIT(C) or + (C =:= $-) or (C =:= $.) or (C =:= $_) or + (C =:= $~) or (C =:= $+) or (C =:= $/)). -define(IS_URI_UNRESERVED(C), - ?IS_ALPHA(C) orelse ?IS_DIGIT(C) orelse - C =:= $- orelse C =:= $. orelse C =:= $_ orelse C =:= $~). + ?IS_ALPHA(C) or ?IS_DIGIT(C) or + (C =:= $-) or (C =:= $.) or (C =:= $_) or (C =:= $~)). -define(IS_URI_SUB_DELIMS(C), - C =:= $! orelse C =:= $$ orelse C =:= $& orelse C =:= $' orelse - C =:= $( orelse C =:= $) orelse C =:= $* orelse C =:= $+ orelse - C =:= $, orelse C =:= $; orelse C =:= $=). + (C =:= $!) or (C =:= $$) or (C =:= $&) or (C =:= $') or + (C =:= $() or (C =:= $)) or (C =:= $*) or (C =:= $+) or + (C =:= $,) or (C =:= $;) or (C =:= $=)). -define(IS_VCHAR(C), C =:= $\t; C > 31, C < 127). -define(IS_VCHAR_OBS(C), C =:= $\t; C > 31, C =/= 127). --define(IS_WS(C), C =:= $\s orelse C =:= $\t). --define(IS_WS_COMMA(C), ?IS_WS(C) orelse C =:= $,). +-define(IS_WS(C), (C =:= $\s) or (C =:= $\t)). +-define(IS_WS_COMMA(C), ?IS_WS(C) or (C =:= $,)). -endif. -- cgit v1.2.3