Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor Maths/Factorial for more minimal side effects. #477

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
marsonya merged 4 commits into TheAlgorithms:master from Eji4h:master
Jan 22, 2021

Conversation

@Eji4h
Copy link

@Eji4h Eji4h commented Oct 16, 2020

Welcome to JavaScript community

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new JavaScript files are placed inside an existing directory.
  • All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

Copy link
Author

Eji4h commented Oct 18, 2020

@pomkarnath98 Why to don't merge this PR?

Copy link
Member

Factorial is already there in the list. So we can only merge if it is not present in the list. Hope you understand.
Thank you

Copy link
Author

Eji4h commented Oct 19, 2020

Factorial is already there in the list. So we can only merge if it is not present in the list. Hope you understand.
Thank you

It's already but i'm refactor code to minimal side effects.

Copy link
Member

Ok, we will get back to you soon.
But you should mention the #{ISSUE_NO} that your code resolved. And if it's not there you could create one and then mention by stating that the code ia fixing that issue.

Eji4h reacted with thumbs up emoji

Copy link
Author

Eji4h commented Oct 19, 2020

Fixed #503

Copy link
Contributor

@marsonya marsonya left a comment

Choose a reason for hiding this comment

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

Hey @Eji4h, the refactoring looks good. There one thing that needs changing.
Move the (num > 0) if condition to the end.

It's a general practice to validate the input first and then calculate and return the solution if the input passes validation.

@marsonya marsonya added the changes required This pull request needs changes label Jan 22, 2021
@cclauss cclauss removed their request for review January 22, 2021 04:23
@Eji4h Eji4h requested a review from marsonya January 22, 2021 05:54
@marsonya marsonya merged commit c8ab618 into TheAlgorithms:master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@marsonya marsonya marsonya approved these changes

Assignees

No one assigned

Labels

changes required This pull request needs changes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /