nickva commented on code in PR #5588:
URL: https://github.com/apache/couchdb/pull/5588#discussion_r2190432318
##########
src/couch/src/couch_util.erl:
##########
@@ -228,8 +228,17 @@ get_value(Key, List, Default) ->
Default
end.
-set_value(Key, List, Value) ->
- lists:keyreplace(Key, 1, List, {Key, Value}).
+% insert or update a {Key, Value} tuple in a list of tuples
+-spec set_value(Key, TupleList1, Value) -> TupleList2 when
+ Key :: term(),
+ TupleList1 :: [Tuple],
+ Value :: any(),
+ TupleList2 :: [Tuple].
Review Comment:
I think we're missing a `Tuple :: tuple()` or just use the `tuple()` type?
Does it matter that it's `term()` vs `any()` for Key and Value. Maybe make
them both `term()`?
--
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]