caiconghui commented on a change in pull request #8486:
URL: https://github.com/apache/incubator-doris/pull/8486#discussion_r830016321



##########
File path: be/src/olap/tablet_manager.cpp
##########
@@ -89,42 +85,39 @@ TabletManager::~TabletManager() {
     DEREGISTER_HOOK_METRIC(tablet_meta_mem_consumption);
 }
 
-OLAPStatus TabletManager::_add_tablet_unlocked(TTabletId tablet_id, SchemaHash 
schema_hash,
-                                               const TabletSharedPtr& tablet, 
bool update_meta,
-                                               bool force) {
+OLAPStatus TabletManager::_add_tablet_unlocked(TTabletId tablet_id, const 
TabletSharedPtr& tablet, 
+    bool update_meta, bool force) {
     OLAPStatus res = OLAP_SUCCESS;
     VLOG_NOTICE << "begin to add tablet to TabletManager. "
-                << "tablet_id=" << tablet_id << ", schema_hash=" << schema_hash
+                << "tablet_id=" << tablet_id
                 << ", force=" << force;
 
     TabletSharedPtr existed_tablet = nullptr;
     tablet_map_t& tablet_map = _get_tablet_map(tablet_id);
-    for (TabletSharedPtr item : tablet_map[tablet_id].table_arr) {
-        if (item->equal(tablet_id, schema_hash)) {
-            existed_tablet = item;
-            break;
-        }
+    if (tablet_map.find(tablet_id) != tablet_map.end()) {

Review comment:
       use iterator?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to