aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/base32
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-09-23 17:17:14 +0100
committergingerBill <bill@gingerbill.org>2020-09-23 17:17:14 +0100
commitfc4fdd588e5bd0c45d04c792267a0f4434c6a38e (patch)
tree59bcddc60248dd78ed1155dd7a6ae7ae3de2e07e /core/encoding/base32
parent4844dd4d96f0921f44e70c9960d3e4476aad7115 (diff)
Remove usage of `do` in core library
Diffstat (limited to 'core/encoding/base32')
-rw-r--r--core/encoding/base32/base32.odin8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/encoding/base32/base32.odin b/core/encoding/base32/base32.odin
index 9949a5e4f..dad9d3e04 100644
--- a/core/encoding/base32/base32.odin
+++ b/core/encoding/base32/base32.odin
@@ -92,7 +92,9 @@ _encode :: proc(out, data: []byte, ENC_TBL := ENC_TABLE, allocator := context.al
}
decode :: proc(data: string, DEC_TBL := DEC_TABLE, allocator := context.allocator) -> []byte #no_bounds_check{
- if len(data) == 0 do return []byte{};
+ if len(data) == 0 {
+ return nil;
+ }
outi := 0;
olen := len(data);
@@ -113,7 +115,9 @@ decode :: proc(data: string, DEC_TBL := DEC_TABLE, allocator := context.allocato
data = data[1:];
if input == byte(PADDING) && j >= 2 && len(data) < 8 {
assert(!(len(data) + j < 8 - 1), "Corrupted input");
- for k := 0; k < 8-1-j; k +=1 do assert(len(data) < k || data[k] == byte(PADDING), "Corrupted input");
+ for k := 0; k < 8-1-j; k +=1 {
+ assert(len(data) < k || data[k] == byte(PADDING), "Corrupted input");
+ }
dlen, end = j, true;
assert(dlen != 1 && dlen != 3 && dlen != 6, "Corrupted input");
break;