Skip to content

Separate RDoc::TokenStream#add_tokens and #add_token #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2019

Conversation

mame
Copy link
Member

@mame mame commented Aug 6, 2019

The old version of add_tokens accepts an array of tokens, and
multiple arguments of tokens by using Array#flatten.
And add_token was an alias to add_tokens.

I think it is unnecessarily flexible; in fact, all callsites of
add_tokens (except test) passes only an array of tokens.
And the code created a lot of temporal arrays.

This change makes add_tokens accept only one array of tokens,
and does add_token accept one token. It is a bit faster (about
1 second in Ruby's make rdoc), and it ls also cleaner in my point of
view.

The old version of `add_tokens` accepts an array of tokens, and
multiple arguments of tokens by using `Array#flatten`.
And `add_token` was an alias to `add_tokens`.

I think it is unnecessarily flexible; in fact, all callsites of
`add_tokens` (except test) passes only an array of tokens.
And the code created a lot of temporal arrays.

This change makes `add_tokens` accept only one array of tokens,
and does `add_token` accept one token.  It is a bit faster (about
1 second in Ruby's `make rdoc`), and it ls also cleaner in my point of
view.
@aycabta aycabta merged commit 6f98554 into ruby:master Aug 15, 2019
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.

2 participants