Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify
  • Loading branch information
Christoph Bergmeister committed Apr 22, 2020
commit d5e52293036aaba358192dbb2b26d65cf265fb22
6 changes: 2 additions & 4 deletions Rules/UseConsistentIndentation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string file

private static bool LineHasPipelineBeforeToken(Token[] tokens, int tokenIndex, Token token)
{
bool lineHasPipelineBeforeToken = false;
var searchIndex = tokenIndex;
var searchLine = token.Extent.StartLineNumber;
do
Expand All @@ -265,12 +264,11 @@ private static bool LineHasPipelineBeforeToken(Token[] tokens, int tokenIndex, T
var searchcolumn = tokens[searchIndex].Extent.StartColumnNumber;
if (tokens[searchIndex].Kind == TokenKind.Pipe && searchcolumn < token.Extent.StartColumnNumber)
{
lineHasPipelineBeforeToken = true;
break;
return true;
}
searchIndex--;
} while (searchLine == token.Extent.StartLineNumber && searchIndex >= 0);
return lineHasPipelineBeforeToken;
return false;
}

private static CommandBaseAst LastPipeOnFirstLineWithPipeUsage(PipelineAst pipelineAst)
Expand Down