summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@gmail.com>2022-10-25 16:00:12 -0400
committerNick Vatamaniuc <nickva@users.noreply.github.com>2022-10-25 16:50:46 -0400
commit63d71bec8ea9b59660645830ff822deef7d698c1 (patch)
tree3a69f36087433a33561fd3ac1fc96e56f328e73e
parent61d4d045f9fce64f1a4fcdd1f2bacbf11ad51cc1 (diff)
downloadcouchdb-63d71bec8ea9b59660645830ff822deef7d698c1.tar.gz
A few more Erlang <23 cleanups
Thanks to Ilya for noticing and catching these!
-rw-r--r--src/couch/src/couch_httpd_auth.erl8
-rw-r--r--src/couch/src/couch_server.erl5
2 files changed, 2 insertions, 11 deletions
diff --git a/src/couch/src/couch_httpd_auth.erl b/src/couch/src/couch_httpd_auth.erl
index c30854986..4a7b217d1 100644
--- a/src/couch/src/couch_httpd_auth.erl
+++ b/src/couch/src/couch_httpd_auth.erl
@@ -729,13 +729,7 @@ generate_token(Alg, Key, Len, Timestamp) ->
integer_to_binary(couch_totp:generate(Alg, Key, Timestamp, 30, Len), Len).
integer_to_binary(Int, Len) when is_integer(Int), is_integer(Len) ->
- Unpadded =
- case erlang:function_exported(erlang, integer_to_binary, 1) of
- true ->
- erlang:integer_to_binary(Int);
- false ->
- ?l2b(integer_to_list(Int))
- end,
+ Unpadded = erlang:integer_to_binary(Int),
Padding = binary:copy(<<"0">>, Len),
Padded = <<Padding/binary, Unpadded/binary>>,
binary:part(Padded, byte_size(Padded), -Len).
diff --git a/src/couch/src/couch_server.erl b/src/couch/src/couch_server.erl
index 4cb858295..7c96c9953 100644
--- a/src/couch/src/couch_server.erl
+++ b/src/couch/src/couch_server.erl
@@ -287,10 +287,7 @@ init([N]) ->
config:enable_feature('access-ready'),
% Mark if fips is enabled
- case
- erlang:function_exported(crypto, info_fips, 0) andalso
- crypto:info_fips() == enabled
- of
+ case crypto:info_fips() == enabled of
true ->
config:enable_feature('fips');
false ->