ref: 34a0fe0d51a0bf0679d2d3b4c09140c8447dac2c
parent: b39e8ca0f806bd6a76f378373cb4d27fcf028190
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Mar 24 18:49:10 EDT 2018
Handle zero length needles.
--- a/lib/std/strfind.myr
+++ b/lib/std/strfind.myr
@@ -22,6 +22,9 @@
if start > end
inc = -1
;;
+ if needle.len == 0
+ -> `None
+ ;;
for var i = start; i != end; i += inc
/*
if we knew the direction we could terminate early,