1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

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!***')