mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 10:41:58 +02:00
Micro-optimization
This commit is contained in:
@@ -781,9 +781,13 @@ contrast(Color* self, PyObject *o) {
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
hexchar_to_int(char c) {
|
hexchar_to_int(char c) {
|
||||||
if ('0' <= c && c <= '9') return c - '0';
|
switch (c) {
|
||||||
if ('a' <= c && c <= 'f') return c - 'a' + 10;
|
START_ALLOW_CASE_RANGE
|
||||||
if ('A' <= c && c <= 'F') return c - 'A' + 10;
|
case '0' ... '9': return c - '0';
|
||||||
|
case 'a' ... 'f': return c - 'a' + 10;
|
||||||
|
case 'A' ... 'F': return c - 'A' + 10;
|
||||||
|
END_ALLOW_CASE_RANGE
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user