perf(highlight): don't allocate duplicates for color names

This commit is contained in:
bfredl
2022-06-21 12:29:49 +02:00
parent 5ad97fcc0e
commit 374e0b6678
6 changed files with 129 additions and 96 deletions

View File

@@ -962,7 +962,8 @@ int object_to_color(Object val, char *key, bool rgb, Error *err)
}
int color;
if (rgb) {
color = name_to_color(str.data);
int dummy;
color = name_to_color(str.data, &dummy);
} else {
color = name_to_ctermcolor(str.data);
}