Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
more code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
maxijabase committed Nov 11, 2022
1 parent e8b2c68 commit b137580
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions SourcepawnCondenser/SourcepawnCondenser/Condenser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,15 @@ private int BacktraceTestForToken(int startPosition, TokenKind testKind, bool ig
{
for (var i = startPosition; i >= 0; --i)
{
if (_tokens[i].Kind == testKind)
{
return i;
}

if (ignoreOtherTokens)
if (ignoreOtherTokens || (_tokens[i].Kind == TokenKind.EOL && ignoreEol))
{
continue;
}

if (_tokens[i].Kind == TokenKind.EOL && ignoreEol)
if (_tokens[i].Kind == testKind)
{
continue;
return i;
}

return -1;
}

return -1;
Expand All @@ -93,22 +86,15 @@ private int FortraceTestForToken(int startPosition, TokenKind testKind, bool ign
{
for (var i = startPosition; i < _length; ++i)
{
if (_tokens[i].Kind == testKind)
{
return i;
}

if (ignoreOtherTokens)
if (ignoreOtherTokens || (_tokens[i].Kind == TokenKind.EOL && ignoreEol))
{
continue;
}

if (_tokens[i].Kind == TokenKind.EOL && ignoreEol)
if (_tokens[i].Kind == testKind)
{
continue;
return i;
}

return -1;
}

return -1;
Expand Down

0 comments on commit b137580

Please sign in to comment.