mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string: do not free empty strings
This commit is contained in:
parent
ca63b92d4f
commit
af27963938
@ -1183,7 +1183,9 @@ pub fn (c byte) is_letter() bool {
|
||||
}
|
||||
|
||||
pub fn (s &string) free() {
|
||||
if s.is_lit {return}
|
||||
if s.is_lit || s.len == 0 {
|
||||
return
|
||||
}
|
||||
free(s.str)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user