Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMagnan committed Mar 27, 2024
1 parent d1574ef commit 43d5133
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/HtmlAgilityPack.Shared/HtmlDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1742,15 +1742,15 @@ private void Parse()
if ((_currentnode._namelength + 3) <= (Text.Length - (_index - 1)))
{
var tagStartMatching = Text[_index - 1] == '<' && Text[_index] == '/';
var tagMatching = string.Compare(
var tagMatching = tagStartMatching && string.Compare(
Text,
_index + 1,
_currentnode.Name,
0,
_currentnode._namelength,
StringComparison.OrdinalIgnoreCase)
== 0;
if (tagStartMatching && tagMatching)
StringComparison.OrdinalIgnoreCase) == 0;

if (tagMatching)
{
int c = Text[_index - 1 + 2 + _currentnode.Name.Length];
if ((c == '>') || (IsWhiteSpace(c)))
Expand Down

0 comments on commit 43d5133

Please sign in to comment.