vlib: simplify byte character conditions by using methods like is_capital, is_lower, is_letter etc (#21725)

This commit is contained in:
Turiiya 2024-06-25 08:55:08 +02:00 committed by GitHub
parent a536c03365
commit 5b9358279a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 22 additions and 29 deletions

View file

@ -39,7 +39,7 @@ pub fn (c u8) is_digit() bool {
// Example: assert u8(`F`) == true
@[inline]
pub fn (c u8) is_hex_digit() bool {
return (c >= `0` && c <= `9`) || (c >= `a` && c <= `f`) || (c >= `A` && c <= `F`)
return c.is_digit() || (c >= `a` && c <= `f`) || (c >= `A` && c <= `F`)
}
// is_oct_digit returns `true` if the byte is in range 0-7 and `false` otherwise.