Skip to content

Commit

Permalink
cleaner comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JalonSolov committed Nov 4, 2023
1 parent 11db6f2 commit 9d289c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/encoding/utf8/utf8_util.v
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,13 @@ fn up_low(s string, upper_flag bool) string {
if ch_len == 1 {
if upper_flag == true {
unsafe {
// Subtract 0x20 (ASCII space char) from ASCII lowercase to convert to uppercase.
// Subtract 0x20 from ASCII lowercase to convert to uppercase.
c := s[index]
str_res[index] = if c >= 0x61 && c <= 0x7a { c - 0x20 } else { c }
}
} else {
unsafe {
// Add 0x20 (ASCII space char) to ASCII uppercase to convert to lowercase.
// Add 0x20 to ASCII uppercase to convert to lowercase.
c := s[index]
str_res[index] = if c >= 0x41 && c <= 0x5a { c + 0x20 } else { c }
}
Expand Down

0 comments on commit 9d289c2

Please sign in to comment.