Skip to content

Re-implement rc_splitwords to accommodate arbitrarily many words#37

Open
spacefrogg wants to merge 1 commit into
apenwarr:mainfrom
spacefrogg:splitwords
Open

Re-implement rc_splitwords to accommodate arbitrarily many words#37
spacefrogg wants to merge 1 commit into
apenwarr:mainfrom
spacefrogg:splitwords

Conversation

@spacefrogg

Copy link
Copy Markdown
Contributor

Tested with zsh, bash, dash, ash (busybox) and /bin/sh pointing to bash.
Test patterns:

rc_splitwords '"a b"' "'c d'" 'e\ f' "g\ h" i\\\ j

rc_splitwords $(seq 10000)
rc_splitwords "$(seq 10000)"

For the long sequence tests, performance was still a sub-second response with bash being considerably slower than the other shells.

As a side note: I object to the suppression of empty arguments, as these might be valid input, but kept it for compatibility.

Tested with zsh, bash, dash, ash (busybox) and /bin/sh pointing to bash.
Test patterns:

rc_splitwords '"a b"' "'c d'" 'e\ f' "g\ h" i\\\ j

rc_splitwords $(seq 10000)
rc_splitwords "$(seq 10000)"
@spacefrogg

Copy link
Copy Markdown
Contributor Author

Ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant