Skip to content

Commit 33d0c48

Browse files
committed
correctly iterate over named colors
fixup to 4f51c64
1 parent 325ad38 commit 33d0c48

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

csscolorparser.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,9 @@ optional<Color> parse(const std::string& css_str) {
185185
// Convert to lowercase.
186186
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
187187

188-
189-
for (size_t i = 0; i < namedColorCount; i++) {
190-
if (str == namedColors[i].name) {
191-
return { namedColors[i].color };
188+
for (const auto& namedColor : namedColors) {
189+
if (str == namedColor.name) {
190+
return { namedColor.color };
192191
}
193192
}
194193

0 commit comments

Comments
 (0)