mirror of
https://github.com/correl/urilib.git
synced 2024-11-25 03:00:16 +00:00
More efficient implementation of hex_to_upper
This commit is contained in:
parent
bcc245b2a9
commit
72a8a66488
2 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
{application, urilib, [
|
{application, urilib, [
|
||||||
{description, "A RFC-3986 URI Library for parsing and building URIs"},
|
{description, "A RFC-3986 URI Library for parsing and building URIs"},
|
||||||
{vsn,"0.2.0"},
|
{vsn,"0.3.0"},
|
||||||
{licenses, ["BSD"]},
|
{licenses, ["BSD"]},
|
||||||
{links, [{"Github", "https://github.com/gmr/urilib"}]},
|
{links, [{"Github", "https://github.com/gmr/urilib"}]},
|
||||||
{maintainers, ["Gavin M. Roy"]},
|
{maintainers, ["Gavin M. Roy"]},
|
||||||
|
|
|
@ -323,11 +323,11 @@ url_maybe_add_fragment(Value, URL) ->
|
||||||
hex_to_upper(Value) ->
|
hex_to_upper(Value) ->
|
||||||
hex_to_upper(Value, []).
|
hex_to_upper(Value, []).
|
||||||
hex_to_upper([], Accum) ->
|
hex_to_upper([], Accum) ->
|
||||||
Accum;
|
lists:reverse(Accum);
|
||||||
hex_to_upper([$%, B1, B2|T], Accum) ->
|
hex_to_upper([$%, B1, B2|T], Accum) ->
|
||||||
hex_to_upper(T, lists:append(Accum, [$%, to_upper(B1), to_upper(B2)]));
|
hex_to_upper(T, [to_upper(B2), to_upper(B1), $% | Accum]);
|
||||||
hex_to_upper([H|T], Accum) ->
|
hex_to_upper([H|T], Accum) ->
|
||||||
hex_to_upper(T, lists:append(Accum, [H])).
|
hex_to_upper(T, [H | Accum]).
|
||||||
|
|
||||||
|
|
||||||
-spec to_upper(char()) -> char().
|
-spec to_upper(char()) -> char().
|
||||||
|
|
Loading…
Reference in a new issue