You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2022/10/25 20:01:03 UTC

[couchdb] 01/01: A few more Erlang <23 cleanups

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch a-few-more-erlang-23-cleanups
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 7628722d4360eb679ec86ccd7849e0a1bee77014
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Tue Oct 25 16:00:12 2022 -0400

    A few more Erlang <23 cleanups
    
    Thanks to Ilya for noticing and catching these!
---
 src/couch/src/couch_httpd_auth.erl | 8 +-------
 src/couch/src/couch_server.erl     | 5 +----
 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 ->