builtin: simplify the .si_c and .si_vp cases in StrIntpData.get_fmt_format, free intermediate results

pull/10394/head
Delyan Angelov 2021-06-08 13:28:23 +03:00
parent d2bc9ee7bc
commit 665c386771
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 6 additions and 2 deletions

View File

@ -593,11 +593,15 @@ fn (data StrIntpData) get_fmt_format(mut sb strings.Builder) {
}
// runes
.si_c {
sb.write_string(utf32_to_str(data.d.d_c))
ss := utf32_to_str(data.d.d_c)
sb.write_string(ss)
ss.free()
}
// v pointers
.si_vp {
sb.write_string(u64(data.d.d_vp).hex())
ss := u64(data.d.d_vp).hex()
sb.write_string(ss)
ss.free()
}
else {
sb.write_string('***ERROR!***')