nickva commented on code in PR #4659:
URL: https://github.com/apache/couchdb/pull/4659#discussion_r1272427507


##########
src/couch/src/couch_util.erl:
##########
@@ -870,3 +871,19 @@ remove_sensitive_data(KVList) ->
     KVList1 = lists:keyreplace(<<"password">>, 1, KVList, {<<"password">>, 
<<"****">>}),
     % some KVList entries are atoms, so test fo this too
     lists:keyreplace(password, 1, KVList1, {password, <<"****">>}).
+
+% Alternative to `lists:uniq/1` until OTP 26 becomes the oldest
+% supported version.
+-spec nub(list()) -> list().
+nub(L) ->
+    nub_int(L, sets:new()).

Review Comment:
   Since we support OTP 24+ we can use a generally faster version of `sets` 
with `sets:new([{version, 2}]).`
   
   https://www.erlang.org/doc/man/sets.html
   
   It might not matter for indexable_fields as much but since it's in 
`couch_util` we might end up using it some place where it might make a 
difference.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to