morningman commented on code in PR #13993: URL: https://github.com/apache/doris/pull/13993#discussion_r1014967466
########## be/src/olap/rowset/rowset_meta.h: ########## @@ -53,12 +53,14 @@ class RowsetMeta { } virtual bool init_from_pb(const RowsetMetaPB& rowset_meta_pb) { - _rowset_meta_pb = rowset_meta_pb; - if (_rowset_meta_pb.has_tablet_schema()) { + if (rowset_meta_pb.has_tablet_schema()) { _schema = TabletSchemaCache::instance()->insert( - _rowset_meta_pb.tablet_schema().SerializeAsString()); - _rowset_meta_pb.clear_tablet_schema(); + rowset_meta_pb.tablet_schema().SerializeAsString()); } + auto& mut_rowset_meta_pb = const_cast<RowsetMetaPB&>(rowset_meta_pb); Review Comment: Could you add some comment to explain this? It is unusual to use `const_cast` to a const parameter, which breaks the semantics of the method. -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org