From 608b81066d634deb1c57f7f061813c9bfd4439db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 17 Jan 2024 13:50:26 +0000 Subject: [PATCH] reuse slice when constructing unchangedColsArray --- flow/connectors/postgres/normalize_stmt_generator.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flow/connectors/postgres/normalize_stmt_generator.go b/flow/connectors/postgres/normalize_stmt_generator.go index 9c292ef252..3f38dfb9c9 100644 --- a/flow/connectors/postgres/normalize_stmt_generator.go +++ b/flow/connectors/postgres/normalize_stmt_generator.go @@ -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))