shithub: mc

Download patch

ref: 6368976a9e8e4121c5867ec81842e1d4bac55351
parent: a57d9fd3e0a6dd268872ed89d6a41c723d909b2e
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Jan 31 19:19:20 EST 2017

Readability improvements.

	Compress the match statement.

--- a/lib/bio/iter.myr
+++ b/lib/bio/iter.myr
@@ -18,14 +18,11 @@
 impl iterable lineiter -> byte[:] =
 	__iternext__ = {itp, outp
 		match bio.readln((itp# : file#))
-		| `Ok ln:
-			outp# = ln
-			-> true
-		| `Eof:
-			-> false
-		| `Err _:
-			-> false
+		| `Ok ln:	outp# = ln
+		| `Err _:	-> false
+		| `Eof:		-> false
 		;;
+		-> true
 	}
 
 	__iterfin__ = {itp, outp
@@ -40,14 +37,11 @@
 impl iterable chariter -> char =
 	__iternext__ = {itp, outp : char#
 		match bio.getc((itp# : file#))
-		| `Ok c:
-			outp# = c
-			-> true
-		| `Eof:
-			-> false
-		| `Err _:
-			-> false
+		| `Ok c:	outp# = c
+		| `Err _:	-> false
+		| `Eof:		-> false
 		;;
+		-> true
 	}
 
 	__iterfin__ = {itp, outp