Skip to content

Commit

Permalink
[ci] Refactor with foreach in string.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Oct 25, 2022
1 parent f818f81 commit 0eaca83
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions recoil.ci
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ class Stream

internal bool Expect!(string s)
{
int length = s.Length;
for (int i = 0; i < length; i++)
if (ReadByte() != s[i])
foreach (int c in s)
if (ReadByte() != c)
return false;
return true;
}
Expand Down Expand Up @@ -4956,9 +4955,8 @@ public class RECOIL

internal static bool IsStringAt(byte[] content, int contentOffset, string s)
{
int length = s.Length;
for (int i = 0; i < length; i++)
if (content[contentOffset + i] != s[i])
foreach (int c in s)
if (content[contentOffset++] != c)
return false;
return true;
}
Expand Down

0 comments on commit 0eaca83

Please sign in to comment.