Skip to content

Commit 2abf034

Browse files
committed
chore: simplify HandleCase method implementation
1 parent 9d8ebc3 commit 2abf034

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Yubico.Core/src/Yubico/Core/Buffers/Base16.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,13 @@ public void Decode(ReadOnlySpan<char> encoded, Span<byte> data)
131131

132132
// The decoding needs to be case-insensitive. This lets us handle that
133133
// in cases where the norm is upper or lower.
134-
char HandleCase(char c)
135-
{
136-
return DefaultLowerCase
134+
char HandleCase(char c) => DefaultLowerCase
137135
? (char)((c - 0x40) * (0x5b - c) > 0
138136
? c + 0x20
139137
: c)
140138
: (char)((c - 0x60) * (0x7b - c) > 0
141139
? c - 0x20
142140
: c);
143-
}
144141

145142
int GetNibble(char c)
146143
{

0 commit comments

Comments
 (0)