mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
@@ -15,19 +15,19 @@ struct B32Impl
|
||||
static constexpr char Encode(uint8 v)
|
||||
{
|
||||
ASSERT(v < 0x20);
|
||||
if (v < 26) return 'A'+v;
|
||||
else return '2' + (v-26);
|
||||
if (v < 26) { return 'A' + v; }
|
||||
else { return '2' + (v - 26); }
|
||||
}
|
||||
|
||||
static constexpr uint8 DECODE_ERROR = 0xff;
|
||||
static constexpr uint8 Decode(uint8 v)
|
||||
{
|
||||
if (v == '0') return Decode('O');
|
||||
if (v == '1') return Decode('l');
|
||||
if (v == '8') return Decode('B');
|
||||
if (('A' <= v) && (v <= 'Z')) return (v-'A');
|
||||
if (('a' <= v) && (v <= 'z')) return (v-'a');
|
||||
if (('2' <= v) && (v <= '7')) return (v-'2')+26;
|
||||
if (v == '0') { return Decode('O'); }
|
||||
if (v == '1') { return Decode('l'); }
|
||||
if (v == '8') { return Decode('B'); }
|
||||
if (('A' <= v) && (v <= 'Z')) { return (v - 'A'); }
|
||||
if (('a' <= v) && (v <= 'z')) { return (v - 'a'); }
|
||||
if (('2' <= v) && (v <= '7')) { return (v - '2') + 26; }
|
||||
return DECODE_ERROR;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user