summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-25 12:10:41 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-12 11:57:20 -0700
commitf7fc1cd4e2b36f2ae8d124c4654eac7f48aadff8 (patch)
treee0ebb3222750149946e2daa798d7a78383e991bc
parentec17d9295920ba33dee1fa5348bf35fca2b88665 (diff)
downloadmc-f7fc1cd4e2b36f2ae8d124c4654eac7f48aadff8.tar.gz
Minor cleanups on bio geti.
-rw-r--r--lib/bio/geti.myr18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/bio/geti.myr b/lib/bio/geti.myr
index 3b6eb3e..c7ae74e 100644
--- a/lib/bio/geti.myr
+++ b/lib/bio/geti.myr
@@ -21,14 +21,11 @@ pkg bio =
little endian format
*/
generic getle = {f, n -> std.result(@a::(numeric,integral), err)
- var v, i
-
- v = 0
match ensureread(f, n)
- | `std.Err e:
- -> `std.Err e
+ | `std.Err e : -> `std.Err e
| `std.Ok _:
- for i = 0; i < n; i++
+ var v = 0
+ for var i = 0; i < n; i++
v |= (f.rbuf[f.rstart++] : uint64) << (8*(i : uint64))
;;
-> `std.Ok (v : @a::(numeric,integral))
@@ -40,14 +37,11 @@ generic getle = {f, n -> std.result(@a::(numeric,integral), err)
big endian format
*/
generic getbe = {f, n -> std.result(@a::(numeric,integral), err)
- var v, i
-
- v = 0
match ensureread(f, n)
- | `std.Err e:
- -> `std.Err e
+ | `std.Err e : -> `std.Err e
| `std.Ok _:
- for i = 0; i < n; i++
+ var v = 0
+ for var i = 0; i < n; i++
v <<= 8
v |= (f.rbuf[f.rstart++] : uint64)
;;