From 80a727f1ce74ebb3b4cf0c5a6f75d894638512c8 Mon Sep 17 00:00:00 2001 From: Chris Heller Date: Wed, 21 Dec 2016 12:15:33 -0800 Subject: [PATCH] Change error handling to use assert as per Araq's comment --- lib/pure/strutils.nim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 45c2669f9..314c94909 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -808,10 +808,7 @@ proc split*(s: string, sep: string, maxsplit: int = -1): seq[string] {.noSideEff ## ## Substrings are separated by the string `sep`. This is a wrapper around the ## `split iterator <#split.i,string,string>`_. - ## - ## If `sep` is an empty string, `ValueError` is raised. - if sep.len == 0: - raise newException(ValueError, "invalid separator: empty string not allowed") + assert(sep.len > 0) accumulateResult(split(s, sep, maxsplit))