imay commented on a change in pull request #3276: [refactor] A small refactor
on class DataDir
URL: https://github.com/apache/incubator-doris/pull/3276#discussion_r405363840
##########
File path: be/src/olap/data_dir.cpp
##########
@@ -395,69 +395,47 @@ OLAPStatus DataDir::get_shard(uint64_t* shard) {
return OLAP_SUCCESS;
}
-OLAPStatus DataDir::register_tablet(Tablet* tablet) {
- std::lock_guard<std::mutex> l(_mutex);
-
+void DataDir::register_tablet(Tablet* tablet) {
TabletInfo tablet_info(tablet->tablet_id(), tablet->schema_hash(),
tablet->tablet_uid());
- _tablet_set.insert(tablet_info);
- return OLAP_SUCCESS;
-}
-OLAPStatus DataDir::deregister_tablet(Tablet* tablet) {
std::lock_guard<std::mutex> l(_mutex);
+ _tablet_set.emplace(tablet_info);
Review comment:
```suggestion
_tablet_set.emplace(std::move(tablet_info));
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]