Skip to content

Commit

Permalink
*: simple code (pingcap#46218)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Aug 18, 2023
1 parent ddb7b36 commit b1f0880
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions infoschema/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b1f0880

Please sign in to comment.