Alexey Serbin has posted comments on this change.

Change subject: Add ComputeIfAbsent methods to map-util
......................................................................


Patch Set 5:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/3593/5/src/kudu/gutil/map-util.h
File src/kudu/gutil/map-util.h:

Line 780: // it uses the lambda function to create a value, inserts it into the 
map, and returns a a pair with
typo: an extra 'a': '...and returns a a pair...'


Line 791: template <class MapContainer, typename Function>
How costly is compute_func compared with locating the key in the map?  If in 
most use cases compute_func is cheap, then it makes sense just to use stock 
insert() method right away, not trying to locate the element first and not 
calling this method.  But I suppose this is not the case, right?


Line 793: ComputeIfAbsentReturnAbsense(MapContainer* container,
Why not to pass the container by reference here?  Is that due to code style?  
If passing by pointer, what if parameter is null?  Is any check needed here?


-- 
To view, visit http://gerrit.cloudera.org:8080/3593
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iba9fa8038e699e66d34ce541cd02c77f46691315
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>
Gerrit-HasComments: Yes

Reply via email to