Skip to content

Commit fcf8f97

Browse files
committed
Minor fix: do not allocate collation map if not neccessary
1 parent 27d6b7e commit fcf8f97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

replication/row_event.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ func (e *TableMapEvent) UnsignedMap() map[int]bool {
401401
// nil is returned if not available or no character columns at all.
402402
func (e *TableMapEvent) CollationMap() map[int]uint64 {
403403

404-
ret := make(map[int]uint64)
405-
406404
if len(e.DefaultCharset) != 0 {
407405
defaultCollation := e.DefaultCharset[0]
408406

@@ -413,6 +411,7 @@ func (e *TableMapEvent) CollationMap() map[int]uint64 {
413411
}
414412

415413
p := 0
414+
ret := make(map[int]uint64)
416415
for i := 0; i < int(e.ColumnCount); i++ {
417416
if !IsCharacterType(e.ColumnType[i]) {
418417
continue
@@ -432,6 +431,7 @@ func (e *TableMapEvent) CollationMap() map[int]uint64 {
432431
if len(e.ColumnCharset) != 0 {
433432

434433
p := 0
434+
ret := make(map[int]uint64)
435435
for i := 0; i < int(e.ColumnCount); i++ {
436436
if !IsCharacterType(e.ColumnType[i]) {
437437
continue

0 commit comments

Comments
 (0)