code review suggestion of checking heredocIndex < equalsIndex to short circuit the 'equals in delimiter' case

This commit is contained in:
Ben Wells
2023-07-26 14:50:59 +00:00
parent 3ee541e26a
commit 4da8c9e69a

View File

@@ -329,11 +329,11 @@ namespace GitHub.Runner.Worker
var isHeredoc = heredocIndex >= 0 && var isHeredoc = heredocIndex >= 0 &&
( (
equalsIndex < 0 || equalsIndex < 0 ||
heredocIndex < equalsIndex ||
( (
heredocIndex > equalsIndex && heredocIndex > equalsIndex &&
OnlyContainsWhiteSpaceBetweenPositions(line, equalsIndex, heredocIndex) OnlyContainsWhiteSpaceBetweenPositions(line, equalsIndex, heredocIndex)
) || heredocIndex < equalsIndex )
); );
if (isHeredoc) if (isHeredoc)