Use concrete types instead of auto when convenient and not redundant (#1757)

This commit is contained in:
Rangi
2025-07-17 14:59:51 -04:00
committed by GitHub
parent 9dddd87893
commit 0c96234532
16 changed files with 67 additions and 68 deletions

View File

@@ -33,7 +33,9 @@ struct Rgba {
// Returns this RGBA as a 32-bit number that can be printed in hex (`%08x`) to yield its CSS
// representation
uint32_t toCSS() const {
auto shl = [](uint8_t val, unsigned shift) { return static_cast<uint32_t>(val) << shift; };
constexpr auto shl = [](uint8_t val, unsigned shift) {
return static_cast<uint32_t>(val) << shift;
};
return shl(red, 24) | shl(green, 16) | shl(blue, 8) | shl(alpha, 0);
}