mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
@@ -15,21 +15,21 @@ struct B64Impl
|
||||
static constexpr char Encode(uint8 v)
|
||||
{
|
||||
ASSERT(v < 0x40);
|
||||
if (v < 26) return 'A' + v;
|
||||
if (v < 52) return 'a' + (v - 26);
|
||||
if (v < 62) return '0' + (v - 52);
|
||||
if (v == 62) return '+';
|
||||
else return '/';
|
||||
if (v < 26) { return 'A' + v; }
|
||||
if (v < 52) { return 'a' + (v - 26); }
|
||||
if (v < 62) { return '0' + (v - 52); }
|
||||
if (v == 62) { return '+'; }
|
||||
else { return '/'; }
|
||||
}
|
||||
|
||||
static constexpr uint8 DECODE_ERROR = 0xff;
|
||||
static constexpr uint8 Decode(uint8 v)
|
||||
{
|
||||
if (('A' <= v) && (v <= 'Z')) return (v - 'A');
|
||||
if (('a' <= v) && (v <= 'z')) return (v - 'a') + 26;
|
||||
if (('0' <= v) && (v <= '9')) return (v - '0') + 52;
|
||||
if (v == '+') return 62;
|
||||
if (v == '/') return 63;
|
||||
if (('A' <= v) && (v <= 'Z')) { return (v - 'A'); }
|
||||
if (('a' <= v) && (v <= 'z')) { return (v - 'a') + 26; }
|
||||
if (('0' <= v) && (v <= '9')) { return (v - '0') + 52; }
|
||||
if (v == '+') { return 62; }
|
||||
if (v == '/') { return 63; }
|
||||
return DECODE_ERROR;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user