David Ribeiro Alves 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...'
Done


Line 791: template <class MapContainer, typename Function>
> How costly is compute_func compared with locating the key in the map?  If i
the contract of this to only compute the new element if it does not exist in 
the map. Independently of how expensive compute_func is we don't want to create 
the element if it's already there.


Line 793: ComputeIfAbsentReturnAbsense(MapContainer* container,
> Why not to pass the container by reference here?  Is that due to code style
it's due to code style. we pass by pointer when we'll be mutating the container 
and by reference when we're not. see this for some context: 
http://stackoverflow.com/questions/26441220/googles-style-guide-about-input-output-parameters-as-pointers


-- 
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