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

@@ -1293,7 +1293,8 @@ void nvim_unsubscribe(uint64_t channel_id, String event)
Integer nvim_get_color_by_name(String name)
FUNC_API_SINCE(1)
{
return name_to_color(name.data);
int dummy;
return name_to_color(name.data, &dummy);
}
/// Returns a map of color names and RGB values.