mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42: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
|
@ -95,7 +95,7 @@ fn (om OpenMode) to_u8() u8 {
|
|||
// level: can be any value of the CompressionLevel enum.
|
||||
// mode: can be any value of the OpenMode enum.
|
||||
pub fn open(name string, level CompressionLevel, mode OpenMode) !&Zip {
|
||||
if name.len == 0 {
|
||||
if name == '' {
|
||||
return error('szip: name of file empty')
|
||||
}
|
||||
p_zip := unsafe { &Zip(C.zip_open(&char(name.str), int(level), char(mode.to_u8()))) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue