Skip to content

Commit

Permalink
reuse slice when constructing unchangedColsArray
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jan 17, 2024
1 parent 1ee61d8 commit 608b810
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flow/connectors/postgres/normalize_stmt_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ func (n *normalizeStmtGenerator) generateUpdateStatements(quotedCols []string) [
}())

for _, cols := range n.unchangedToastColumns {
unquotedUnchangedColsArray := strings.Split(cols, ",")
unchangedColsArray := make([]string, 0, len(unquotedUnchangedColsArray))
for _, unchangedToastCol := range unquotedUnchangedColsArray {
unchangedColsArray = append(unchangedColsArray, QuoteIdentifier(unchangedToastCol))
unchangedColsArray := strings.Split(cols, ",")
for i, unchangedToastCol := range unchangedColsArray {
unchangedColsArray[i] = QuoteIdentifier(unchangedToastCol)
}
otherCols := utils.ArrayMinus(quotedCols, unchangedColsArray)
tmpArray := make([]string, 0, len(otherCols))
Expand Down

0 comments on commit 608b810

Please sign in to comment.