diff --git a/be/src/olap/tablet_schema.cpp b/be/src/olap/tablet_schema.cpp index a0c3ecdfcb491bf..c4f96e2214853dc 100644 --- a/be/src/olap/tablet_schema.cpp +++ b/be/src/olap/tablet_schema.cpp @@ -906,7 +906,7 @@ void TabletColumn::append_sparse_column(TabletColumn column) { _num_sparse_columns++; } -void TabletSchema::append_index(TabletIndex index) { +void TabletSchema::append_index(TabletIndex&& index) { _indexes.push_back(std::move(index)); } diff --git a/be/src/olap/tablet_schema.h b/be/src/olap/tablet_schema.h index 9f0ce351f37cdc5..5fb3deafd773193 100644 --- a/be/src/olap/tablet_schema.h +++ b/be/src/olap/tablet_schema.h @@ -323,7 +323,7 @@ class TabletSchema : public MetadataAdder { } void to_schema_pb(TabletSchemaPB* tablet_meta_pb) const; void append_column(TabletColumn column, ColumnType col_type = ColumnType::NORMAL); - void append_index(TabletIndex index); + void append_index(TabletIndex&& index); void update_index(const TabletColumn& column, const IndexType& index_type, TabletIndex&& index); void remove_index(int64_t index_id); void clear_index();