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

Commit b137580

Browse files
committed
more code cleanups
1 parent e8b2c68 commit b137580

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

SourcepawnCondenser/SourcepawnCondenser/Condenser.cs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,15 @@ private int BacktraceTestForToken(int startPosition, TokenKind testKind, bool ig
6868
{
6969
for (var i = startPosition; i >= 0; --i)
7070
{
71-
if (_tokens[i].Kind == testKind)
72-
{
73-
return i;
74-
}
75-
76-
if (ignoreOtherTokens)
71+
if (ignoreOtherTokens || (_tokens[i].Kind == TokenKind.EOL && ignoreEol))
7772
{
7873
continue;
7974
}
8075

81-
if (_tokens[i].Kind == TokenKind.EOL && ignoreEol)
76+
if (_tokens[i].Kind == testKind)
8277
{
83-
continue;
78+
return i;
8479
}
85-
86-
return -1;
8780
}
8881

8982
return -1;
@@ -93,22 +86,15 @@ private int FortraceTestForToken(int startPosition, TokenKind testKind, bool ign
9386
{
9487
for (var i = startPosition; i < _length; ++i)
9588
{
96-
if (_tokens[i].Kind == testKind)
97-
{
98-
return i;
99-
}
100-
101-
if (ignoreOtherTokens)
89+
if (ignoreOtherTokens || (_tokens[i].Kind == TokenKind.EOL && ignoreEol))
10290
{
10391
continue;
10492
}
10593

106-
if (_tokens[i].Kind == TokenKind.EOL && ignoreEol)
94+
if (_tokens[i].Kind == testKind)
10795
{
108-
continue;
96+
return i;
10997
}
110-
111-
return -1;
11298
}
11399

114100
return -1;

0 commit comments

Comments
 (0)