File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -471,27 +471,24 @@ func (c *Color) Equals(c2 *Color) bool {
471471 if c == nil || c2 == nil {
472472 return false
473473 }
474+
474475 if len (c .params ) != len (c2 .params ) {
475476 return false
476477 }
477478
479+ counts := make (map [Attribute ]int , len (c .params ))
478480 for _ , attr := range c .params {
479- if ! c2 .attrExists (attr ) {
480- return false
481- }
481+ counts [attr ]++
482482 }
483483
484- return true
485- }
486-
487- func (c * Color ) attrExists (a Attribute ) bool {
488- for _ , attr := range c .params {
489- if attr == a {
490- return true
484+ for _ , attr := range c2 .params {
485+ if counts [attr ] == 0 {
486+ return false
491487 }
488+ counts [attr ]--
492489 }
493490
494- return false
491+ return true
495492}
496493
497494func boolPtr (v bool ) * bool {
You can’t perform that action at this time.
0 commit comments