perf(ui): eliminate spurious memory allocations for hl_attr_define event

This commit is contained in:
bfredl
2022-06-25 18:51:55 +02:00
parent 67a04fe6cb
commit 45bee1dafd
7 changed files with 58 additions and 38 deletions

View File

@@ -1409,7 +1409,7 @@ Dictionary get_global_hl_defs(void)
Dictionary attrs = ARRAY_DICT_INIT;
HlGroup *h = &hl_table[i - 1];
if (h->sg_attr > 0) {
attrs = hlattrs2dict(syn_attr2entry(h->sg_attr), true);
attrs = hlattrs2dict(NULL, syn_attr2entry(h->sg_attr), true);
} else if (h->sg_link > 0) {
const char *link = (const char *)hl_table[h->sg_link - 1].sg_name;
PUT(attrs, "link", STRING_OBJ(cstr_to_string(link)));