Skip to content

Commit 1771826

Browse files
committed
const for getInt
1 parent 80b74a3 commit 1771826

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

csscolorparser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,8 @@ Color parseNamedColor(const std::string& css_str, size_t pos, size_t end, bool&
447447
}
448448

449449

450-
uint32_t CSSColorParser::Color::getInt() {
451-
uint32_t color = ((uint32_t)(255.0 * a) << 24) + ((uint32_t)b << 16) + ((uint32_t)g << 8) + ((uint32_t)r);
452-
return color;
450+
uint32_t CSSColorParser::Color::getInt() const {
451+
return ((uint32_t)(255.0 * a) << 24) + ((uint32_t)b << 16) + ((uint32_t)g << 8) + ((uint32_t)r);
453452
}
454453

455454
Color CSSColorParser::parse(const std::string& css_str) {

csscolorparser.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct Color {
4444
: r(r), g(g), b(b), a(a) {}
4545
unsigned char r = 0, g = 0, b = 0;
4646
float a = 1.0f;
47-
uint32_t getInt();
47+
uint32_t getInt() const;
4848
};
4949

5050

0 commit comments

Comments
 (0)