From b1f088040ea1983d14c69f2e481ee5eb97121ebe Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Fri, 18 Aug 2023 15:36:46 +0800 Subject: [PATCH] *: simple code (#46218) --- infoschema/builder.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/infoschema/builder.go b/infoschema/builder.go index 4b6c6627d100b..6008a30d21f65 100644 --- a/infoschema/builder.go +++ b/infoschema/builder.go @@ -834,12 +834,10 @@ func (b *Builder) applyCreateTable(m *meta.Meta, dbInfo *model.DBInfo, tableID i tableNames := b.is.schemaMap[dbInfo.Name.L] tableNames.tables[tblInfo.Name.L] = tbl bucketIdx := tableBucketIdx(tableID) - sortedTbls := b.is.sortedTablesBuckets[bucketIdx] - sortedTbls = append(sortedTbls, tbl) - slices.SortFunc(sortedTbls, func(i, j table.Table) int { + b.is.sortedTablesBuckets[bucketIdx] = append(b.is.sortedTablesBuckets[bucketIdx], tbl) + slices.SortFunc(b.is.sortedTablesBuckets[bucketIdx], func(i, j table.Table) int { return cmp.Compare(i.Meta().ID, j.Meta().ID) }) - b.is.sortedTablesBuckets[bucketIdx] = sortedTbls if tblInfo.TempTableType != model.TempTableNone { b.addTemporaryTable(tableID)