Refactor splits/2 using foreach syntax (remove private filter _nwise) (#3260)
This commit refactors `splits/2` implementation using `foreach` syntax and reduces intermediate arrays. This refactoring removes an unnecessary private (and undocumented) filter `_nwise` and closes #3148.
This commit is contained in:
1 parent
96d19ca2ee
commit
b088e83a82
5 files changed
+37
-21
No files matched your search
Generated
+7
@@ -64,6 +64,13 @@ splits(", *")
|
||||
"ef"
|
||||
"gh"
|
||||
|
||||
splits(",? *"; "n")
|
||||
"ab,cd ef, gh"
|
||||
"ab"
|
||||
"cd"
|
||||
"ef"
|
||||
"gh"
|
||||
|
||||
sub("[^a-z]*(?<x>[a-z]+)"; "Z\(.x)"; "g")
|
||||
"123abc456def"
|
||||
"ZabcZdef"
|
||||
|
||||
Reference in new issue
Block a user