shithub: mc

Download patch

ref: bd548d893500b61c555a9d75bb1be533caba23fc
parent: e1b01e82cbe4968d6cf3c89b543ed2e691bf005f
author: Ori Bernstein <[email protected]>
date: Sun Dec 28 18:44:10 EST 2014

API change: strsplit("") -> [][:]

    Splitting an empty string now gives am empty list, instead
    of a list with a single empty string. Seems more intuitive.

--- a/libstd/strsplit.myr
+++ b/libstd/strsplit.myr
@@ -17,6 +17,9 @@
 	var sp
 
 	sp = [][:]
+	if s.len == 0
+		-> sp
+	;;
 	last = 0
 	while true
 		match strfind(s, delim)