nickva commented on code in PR #5514:
URL: https://github.com/apache/couchdb/pull/5514#discussion_r2056673196
##########
src/couch/src/couch_util.erl:
##########
@@ -862,3 +863,16 @@ ejson_to_map({Val}) when is_list(Val) ->
maps:from_list(lists:map(fun({K, V}) -> {K, ejson_to_map(V)} end, Val));
ejson_to_map(Val) ->
Val.
+
+% Set types were switched to version 2 by default in OTP 28, use this helper to
+% create version 2 sets in OTP versions < 28 as well to avoid having to deal
+% with a different ordered to_list result in tests and just ensure we always
+% use version 2, which is also more performant
+%
+% Remove after OTP >= 28 and switch to plain sets:new/0 and sets:from_list/1
+
Review Comment:
That could work, but it's only in two places and they are next to each
other. The rest of the code now uses the util functions.
I debated initially using just macros (`?NEW_SET()` and `?SET_FROM_LIST()`
that would mean having to use the include couch_db.hrl in a few more places so
settled on a plain utility function.
--
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]