From 5b4012d3627d4433a91c995046ccb2d2405b5e5e Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 14 Jul 2016 14:28:13 +0200 Subject: [PATCH] Avoid string interpolation Not invoking string interpolation when it's not needed is quite a micro optimization but over the course of many iterations it can still be worthwhile. Only strings containing variables or escape sequences need to be within quote marks. --- src/test/regress/atmsort.pm | 12 ++++++------ src/test/regress/gpdiff.pl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/regress/atmsort.pm b/src/test/regress/atmsort.pm index c0fe23daf0..a313d52e58 100644 --- a/src/test/regress/atmsort.pm +++ b/src/test/regress/atmsort.pm @@ -544,7 +544,7 @@ sub format_explain if (exists($directive->{explain}) && ($directive->{explain} =~ m/operator/i)) { - $xopt = "operator"; + $xopt = 'operator'; $sort = 1; } @@ -1264,7 +1264,7 @@ EOF_formatfix # differ because of session level GUCs. if (exists($directive->{explain})) { - $ini = "GP_IGNORE:" . $ini; + $ini = 'GP_IGNORE:' . $ini; } $directive = {}; @@ -1296,7 +1296,7 @@ EOF_formatfix } @outarr = (); - print $atmsort_outfh "GP_IGNORE:", $ini; + print $atmsort_outfh 'GP_IGNORE:', $ini; next; } elsif ($has_comment && ($glob_make_equiv_expected && $ini =~ m/\-\-\s*start\_equiv\s*$/)) @@ -1471,7 +1471,7 @@ EOF_formatfix $has_order = 0; # need to sort query output $directive->{sql_statement} = $sql_statement; } - $sql_statement = ""; + $sql_statement = ''; $getrows = 1; next; @@ -1489,7 +1489,7 @@ EOF_formatfix # MPP-1557,AUTO-3: horrific ERROR DETAIL External Table trifecta if ($glob_verbose) { - print $atmsort_outfh "GP_IGNORE: External Table ERROR DETAIL fixup\n"; + print $atmsort_outfh 'GP_IGNORE: External Table ERROR DETAIL fixup' . "\n"; } if ($ini !~ m/^DETAIL/) { @@ -1507,7 +1507,7 @@ EOF_formatfix if (scalar(@outarr) && ($outarr[-1] =~ m/^ERROR:\s+missing data for column/)) { - $outarr[-1] = "ERROR: missing data for column DUMMY_COL\n"; + $outarr[-1] = 'ERROR: missing data for column DUMMY_COL' . "\n"; } } diff --git a/src/test/regress/gpdiff.pl b/src/test/regress/gpdiff.pl index 9324cb8a55..e9984f8805 100755 --- a/src/test/regress/gpdiff.pl +++ b/src/test/regress/gpdiff.pl @@ -185,7 +185,7 @@ sub gpdiff_files $newf2 = atmsort::run($f2); } - my $args = join(" ", @ARGV, $newf1, $newf2); + my $args = join(' ', @ARGV, $newf1, $newf2); # print "args: $args\n"; -- GitLab