]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/sip: delete redundant computing codes
authorLi Heng <562653799@qq.com>
Tue, 28 Oct 2025 02:59:56 +0000 (10:59 +0800)
committerVictor Julien <vjulien@oisf.net>
Sat, 1 Nov 2025 03:46:30 +0000 (03:46 +0000)
Delete call of is_alphanumeric where is_alphanumeric and
is_token_char are called together. Four places are modified.

Ticket: 8003

rust/src/sip/parser.rs

index ae312dcc31721e58798897ad73e4372225e71eec..9c1e926357e1c6ce88086f30154606b59c492dcd 100644 (file)
@@ -75,7 +75,7 @@ fn is_method_char(b: u8) -> bool {
 
 #[inline]
 fn is_request_uri_char(b: u8) -> bool {
-    b.is_alphanum() || is_token_char(b) || b"~#@:;=?+&$,/".contains(&b)
+    is_token_char(b) || b"~#@:;=?+&$,/".contains(&b)
 }
 
 #[inline]
@@ -85,15 +85,15 @@ fn is_version_char(b: u8) -> bool {
 
 #[inline]
 fn is_reason_phrase(b: u8) -> bool {
-    b.is_alphanum() || is_token_char(b) || b"$&(),/:;=?@[\\]^ ".contains(&b)
+    is_token_char(b) || b"$&(),/:;=?@[\\]^ ".contains(&b)
 }
 
 fn is_header_name(b: u8) -> bool {
-    b.is_alphanum() || is_token_char(b)
+    is_token_char(b)
 }
 
 fn is_header_value(b: u8) -> bool {
-    b.is_alphanum() || is_token_char(b) || b"\"#$&(),/;:<=>?@[]{}()^|~\\\t\n\r ".contains(&b)
+    is_token_char(b) || b"\"#$&(),/;:<=>?@[]{}()^|~\\\t\n\r ".contains(&b)
 }
 
 fn expand_header_name(h: &str) -> &str {