Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix debug assert condition
  • Loading branch information
MihaZupan committed Nov 22, 2022
commit 6f4b8719fa5f33c3fd564aa3c2c831242776e057
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ internal static string ParseCanonicalName(string str, int start, int end, ref bo
int index = str.AsSpan(start, end - start).LastIndexOfAny(s_asciiLetterUpperOrColonChars);
if (index >= 0)
{
Debug.Assert(!str.AsSpan(start, index - start).Contains(':'),
Debug.Assert(!str.AsSpan(start, index).Contains(':'),
"A colon should appear at most once, and must never be followed by letters.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ParseCanonicalName is handed already sanitized data?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


if (str[start + index] == ':')
Expand Down