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:
itchyny authored and GitHub committed 2025-05-18 08:27:44 +09:00
1 parent 96d19ca2ee
commit b088e83a82
5 files changed
+37 -21

No files matched your search

Generated
+4
View File
@@ -3032,6 +3032,10 @@ These provide the same results as their \fBsplit\fR counterparts, but as a strea
jq \'splits(", *")\'
"ab,cd, ef, gh"
=> "ab", "cd", "ef", "gh"
jq \'splits(",? *"; "n")\'
"ab,cd ef, gh"
=> "ab", "cd", "ef", "gh"
.
.fi
.