diff options
author | Chris Heller <chris.heller@greyheller.com> | 2016-12-21 12:15:33 -0800 |
---|---|---|
committer | Chris Heller <chris.heller@greyheller.com> | 2016-12-21 12:15:33 -0800 |
commit | 80a727f1ce74ebb3b4cf0c5a6f75d894638512c8 (patch) | |
tree | 06928007913fe5efabb24ba59481dbb2b85384e2 | |
parent | 40d034b7e37dd3d19f324ec8bcef5fafc03fed2a (diff) | |
download | Nim-80a727f1ce74ebb3b4cf0c5a6f75d894638512c8.tar.gz |
Change error handling to use assert as per Araq's comment
-rw-r--r-- | lib/pure/strutils.nim | 5 |
1 files changed, 1 insertions, 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)) |