Skip to content

Commit

Permalink
Fixed #4 infinite loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
tompazourek committed Apr 18, 2020
1 parent d305c6e commit 519bf07
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public int Compare(string str1, string str2)
return tokenCompare;

// now we know that both tokens are the same kind

// didn't find any more tokens, return that they're equal
if (token1 == TokenNone)
return 0;

var rangeLength1 = endIndex1 - startIndex1;
var rangeLength2 = endIndex2 - startIndex2;

Expand Down

0 comments on commit 519bf07

Please sign in to comment.