Skip to content

Commit

Permalink
Cosmetic: List comprehension instead of recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
majek committed Oct 18, 2011
1 parent 97352b5 commit a4cdaf8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/sockjs_filters.erl
Expand Up @@ -347,13 +347,11 @@ fmt_htmlfile(Body) ->


fmt(Fmt, Args) -> iolist_to_binary(io_lib:format(Fmt, Args)). fmt(Fmt, Args) -> iolist_to_binary(io_lib:format(Fmt, Args)).


url_escape("", _Chars) -> url_escape(Str, Chars) ->
""; [case lists:member(Char, Chars) of
url_escape([Char | Rest], Chars) -> true -> hex(Char);
case lists:member(Char, Chars) of false -> Char
true -> [hex(Char) | url_escape(Rest, Chars)]; end || Char <- Str].
false -> [Char | url_escape(Rest, Chars)]
end.


hex(C) -> hex(C) ->
<<High0:4, Low0:4>> = <<C>>, <<High0:4, Low0:4>> = <<C>>,
Expand Down

0 comments on commit a4cdaf8

Please sign in to comment.