string: do not free empty strings
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