@@ -313,7 +313,7 @@ namespace Sass {
313
313
const Color_RGBA transparent (color_table, 0 , 0 , 0 , 0 );
314
314
}
315
315
316
- const std::map< const int , const char *> colors_to_names {
316
+ static const auto * const colors_to_names = new std::unordered_map< int , const char *> {
317
317
{ 240 * 0x10000 + 248 * 0x100 + 255 , ColorNames::aliceblue },
318
318
{ 250 * 0x10000 + 235 * 0x100 + 215 , ColorNames::antiquewhite },
319
319
{ 0 * 0x10000 + 255 * 0x100 + 255 , ColorNames::cyan },
@@ -455,7 +455,7 @@ namespace Sass {
455
455
{ 102 * 0x10000 + 51 * 0x100 + 153 , ColorNames::rebeccapurple }
456
456
};
457
457
458
- const std::map< const char * , const Color_RGBA*, map_cmp_str> names_to_colors
458
+ static const auto * const names_to_colors = new std::unordered_map<std::string , const Color_RGBA*>
459
459
{
460
460
{ ColorNames::aliceblue, &Colors::aliceblue },
461
461
{ ColorNames::antiquewhite, &Colors::antiquewhite },
@@ -619,20 +619,20 @@ namespace Sass {
619
619
std::string lower{key};
620
620
std::transform (lower.begin (), lower.end (), lower.begin (), ::tolower);
621
621
622
- auto p = names_to_colors. find (lower. c_str () );
623
- if (p != names_to_colors. end ()) {
622
+ auto p = names_to_colors-> find (lower);
623
+ if (p != names_to_colors-> end ()) {
624
624
return p->second ;
625
625
}
626
- return 0 ;
626
+ return nullptr ;
627
627
}
628
628
629
629
const char * color_to_name (const int key)
630
630
{
631
- auto p = colors_to_names. find (key);
632
- if (p != colors_to_names. end ()) {
631
+ auto p = colors_to_names-> find (key);
632
+ if (p != colors_to_names-> end ()) {
633
633
return p->second ;
634
634
}
635
- return 0 ;
635
+ return nullptr ;
636
636
}
637
637
638
638
const char * color_to_name (const double key)
0 commit comments