Skip to content

Commit

Permalink
feat: 性能优化。
Browse files Browse the repository at this point in the history
  • Loading branch information
CYJB committed Mar 24, 2024
1 parent d809ab3 commit d6e147a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions Cyjb.Markdown/ParseBlock/HtmlInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@ internal sealed class HtmlInfo
{
case 5:
// </pre>
return char.ToLowerInvariant(sb[index + 2]) == 'p' &&
char.ToLowerInvariant(sb[index + 3]) == 'r' &&
char.ToLowerInvariant(sb[index + 4]) == 'e';
return (sb[index + 2] is 'p' or 'P') &&
(sb[index + 3] is 'r' or 'R') &&
(sb[index + 4] is 'e' or 'E');
case 7:
// </style>
return char.ToLowerInvariant(sb[index + 2]) == 's' &&
char.ToLowerInvariant(sb[index + 3]) == 't' &&
char.ToLowerInvariant(sb[index + 4]) == 'y' &&
char.ToLowerInvariant(sb[index + 5]) == 'l' &&
char.ToLowerInvariant(sb[index + 6]) == 'e';
return (sb[index + 2] is 's' or 'S') &&
(sb[index + 3] is 't' or 'T') &&
(sb[index + 4] is 'y' or 'Y') &&
(sb[index + 5] is 'l' or 'L') &&
(sb[index + 6] is 'e' or 'E');
case 8:
// </script>
return char.ToLowerInvariant(sb[index + 2]) == 's' &&
char.ToLowerInvariant(sb[index + 3]) == 'c' &&
char.ToLowerInvariant(sb[index + 4]) == 'r' &&
char.ToLowerInvariant(sb[index + 5]) == 'i' &&
char.ToLowerInvariant(sb[index + 6]) == 'p' &&
char.ToLowerInvariant(sb[index + 7]) == 't';
return (sb[index + 2] is 's' or 'S') &&
(sb[index + 3] is 'c' or 'C') &&
(sb[index + 4] is 'r' or 'R') &&
(sb[index + 5] is 'i' or 'I') &&
(sb[index + 6] is 'p' or 'P') &&
(sb[index + 7] is 't' or 'T');
case 10:
// </textarea>
return char.ToLowerInvariant(sb[index + 2]) == 't' &&
char.ToLowerInvariant(sb[index + 3]) == 'e' &&
char.ToLowerInvariant(sb[index + 4]) == 'x' &&
char.ToLowerInvariant(sb[index + 5]) == 't' &&
char.ToLowerInvariant(sb[index + 6]) == 'a' &&
char.ToLowerInvariant(sb[index + 7]) == 'r' &&
char.ToLowerInvariant(sb[index + 8]) == 'e' &&
char.ToLowerInvariant(sb[index + 9]) == 'a';
return (sb[index + 2] is 't' or 'T') &&
(sb[index + 3] is 'e' or 'E') &&
(sb[index + 4] is 'x' or 'X') &&
(sb[index + 5] is 't' or 'T') &&
(sb[index + 6] is 'a' or 'A') &&
(sb[index + 7] is 'r' or 'R') &&
(sb[index + 8] is 'e' or 'E') &&
(sb[index + 9] is 'a' or 'A');
}
index = sb.IndexOf("</", index + 2);
}
Expand Down

0 comments on commit d6e147a

Please sign in to comment.