shithub: mc

Download patch

ref: e1527621e1e1176ad5ff72127a076b1b59c59d07
parent: 5f6c159bba1fd3db27b47755644ee5d66e9d086f
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)