Skip to content

Optimize Color.Equals performance (O(n²) → O(n))#269

Merged
fatih merged 4 commits intofatih:mainfrom
UnSubble:main
Mar 20, 2026
Merged

Optimize Color.Equals performance (O(n²) → O(n))#269
fatih merged 4 commits intofatih:mainfrom
UnSubble:main

Conversation

@UnSubble
Copy link
Copy Markdown
Contributor

@UnSubble UnSubble commented Oct 9, 2025

Replace nested loops in Color.Equals with a map-based lookup to improve performance.
Behavior remains the same (unordered equality, nil-safe, handles duplicates).

@fatih fatih merged commit 5715c20 into fatih:main Mar 20, 2026
1 check passed
@fatih
Copy link
Copy Markdown
Owner

fatih commented Mar 20, 2026

@UnSubble thanks for the improvement. I added a test and merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants