mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
vlib: refactor empty string checks to use s == ''
or s != ''
, instead of s.len == 0
(#21300)
This commit is contained in:
parent
46be635072
commit
8aa9314a99
55 changed files with 95 additions and 96 deletions
|
@ -195,7 +195,7 @@ pub fn (mut b Builder) writeln(s string) {
|
|||
// for c in s {
|
||||
// b.buf << c
|
||||
// }
|
||||
if s.len > 0 {
|
||||
if s != '' {
|
||||
unsafe { b.push_many(s.str, s.len) }
|
||||
}
|
||||
// b.buf << []u8(s) // TODO
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn (b &Builder) byte_at(n int) u8 {
|
|||
}
|
||||
|
||||
pub fn (mut b Builder) write_string(s string) {
|
||||
if s.len == 0 {
|
||||
if s == '' {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ pub fn (mut b Builder) write_string(s string) {
|
|||
}
|
||||
|
||||
pub fn (mut b Builder) writeln(s string) {
|
||||
if s.len > 0 {
|
||||
if s != '' {
|
||||
b.write_string(s)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue