Skip to content
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

Reduce scope such as recursive function #23

Merged
merged 8 commits into from
Nov 5, 2018
Merged

Reduce scope such as recursive function #23

merged 8 commits into from
Nov 5, 2018

Conversation

segayuu
Copy link
Contributor

@segayuu segayuu commented Oct 11, 2018

javascript is hard to optimize for recursive functions.
It would be hopeless to optimize asynchronous functions that span many lines of complexity and do not use async/await.
Therefore, we will try to reduce the complexity by making the recursion place as simple as possible.

@segayuu segayuu requested a review from a team October 11, 2018 02:07
@coveralls
Copy link

coveralls commented Oct 11, 2018

Coverage Status

Coverage decreased (-1.06%) to 94.901% when pulling 79e5e5c on segayuu:Refactoring-function into d350a8d on hexojs:master.

Just by calling checkParent() once, directories up to their parents have been created and it is not necessary to put them in recursion.
Since the recursive function is an internal function,
default arguments are unnecessary if used correctly within one file.
There is no problem if you return a string that does not collide.
@segayuu segayuu requested review from a team and removed request for a team October 23, 2018 02:02
Copy link
Member

@NoahDragon NoahDragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@segayuu segayuu merged commit 325164c into hexojs:master Nov 5, 2018
@segayuu segayuu deleted the Refactoring-function branch November 5, 2018 01:09
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.

3 participants