Skip to content

Commit 2b030a0

Browse files
committed
fix
1 parent b9fc443 commit 2b030a0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Common/Cpp/Options/ColorOption.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,16 @@ std::string ColorCell::to_str() const{
3939
std::string ColorCell::color_to_str(uint32_t color, bool has_alpha){
4040
static const char HEX_DIGITS[] = "0123456789ABCDEF";
4141
std::string str;
42-
size_t c = 0;
4342
if (has_alpha){
44-
str[c++] += HEX_DIGITS[(color >> 28) & 0xf];
45-
str[c++] += HEX_DIGITS[(color >> 24) & 0xf];
43+
str += HEX_DIGITS[(color >> 28) & 0xf];
44+
str += HEX_DIGITS[(color >> 24) & 0xf];
4645
}
47-
str[c++] += HEX_DIGITS[(color >> 20) & 0xf];
48-
str[c++] += HEX_DIGITS[(color >> 16) & 0xf];
49-
str[c++] += HEX_DIGITS[(color >> 12) & 0xf];
50-
str[c++] += HEX_DIGITS[(color >> 8) & 0xf];
51-
str[c++] += HEX_DIGITS[(color >> 4) & 0xf];
52-
str[c++] += HEX_DIGITS[(color >> 0) & 0xf];
46+
str += HEX_DIGITS[(color >> 20) & 0xf];
47+
str += HEX_DIGITS[(color >> 16) & 0xf];
48+
str += HEX_DIGITS[(color >> 12) & 0xf];
49+
str += HEX_DIGITS[(color >> 8) & 0xf];
50+
str += HEX_DIGITS[(color >> 4) & 0xf];
51+
str += HEX_DIGITS[(color >> 0) & 0xf];
5352
return str;
5453
}
5554
ColorCell::operator uint32_t() const{

0 commit comments

Comments
 (0)