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

Remove redundant string creation and copying inside constructor #33

Merged
merged 1 commit into from
May 18, 2018

Conversation

sahmad98
Copy link
Contributor

@sahmad98 sahmad98 commented May 18, 2018

substr() call returns std::string by value, A string of value can be created from absolute value and sign can be decided from comparison which saves extra substr() call and copying overhead.

@faheel faheel merged commit 7ea9929 into faheel:master May 18, 2018
@faheel
Copy link
Owner

faheel commented May 18, 2018

@sahmad98 Thank you! Your contribution will improve BigInt's performance ⚡️

@faheel faheel added the optimisation Performance optimisation label May 18, 2018
@sahmad98 sahmad98 deleted the optimization-in-constructor branch May 18, 2018 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimisation Performance optimisation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants