Adar Dembo has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/11303 )

Change subject: error_manager: rename error types
......................................................................


Patch Set 6:

(1 comment)

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

http://gerrit.cloudera.org:8080/#/c/11303/4/src/kudu/gutil/map-util.h@457
PS4, Line 457:   typedef typename Collection::mapped_type mapped_type;
             :   auto it = collection->find(key);
             :   if (it == collection->end()) {
             :     collection->emplace(key, std::forward<mapped_type>(value));
             :     return true;
             :   }
             :   it->second = std::forward<mapped_type>(value);
             :   return false;
> Ah, yeah seems indeed we can't presume:
I spent some time on this but couldn't make it work.

For one, forwarding args to emplace() seems to destroy the args, even if 
emplace() fails. You observed this as well.
For two, doing find()/emplace() is tricky because I couldn't get the move 
assignment to work in the event that find() returns an existing element.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I377904ee51bb0f7b0f1104d7a4723f74d52e6e3f
Gerrit-Change-Number: 11303
Gerrit-PatchSet: 6
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <granthe...@apache.org>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Comment-Date: Tue, 28 Aug 2018 18:44:41 +0000
Gerrit-HasComments: Yes

Reply via email to