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

[feat/fix]: A Star Search Improvement #1566

Merged
merged 3 commits into from
Aug 27, 2021

Conversation

AshishYUO
Copy link
Contributor

@AshishYUO AshishYUO commented Aug 25, 2021

Description of Change

A Star Search Improvement:

  1. Usage of shared_ptr for reduced object creation and slight performance improvement
  2. Better readability for main algorithm.

Checklist

  • Added description of change
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

Copy link
Member

@ayaankhan98 ayaankhan98 left a comment

Choose a reason for hiding this comment

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

Just few improvements.

test.cpp: In lambda function:
test.cpp:558:31: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  558 |             for (int i = 0; i < first.get_size(); ++i) {
      |                             ~~^~~~~~~~~~~~~~~~~~
test.cpp:559:35: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  559 |                 for (int j = 0; j < first.get_size(); ++j) {
      |                                 ~~^~~~~~~~~~~~~~~~~~
test.cpp:562:39: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  562 |                     for (int k = 0; k < second.get_size(); ++k) {
      |                                     ~~^~~~~~~~~~~~~~~~~~~
test.cpp:563:43: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  563 |                         for (int l = 0; l < second.get_size(); ++l) {
      |                                         ~~^~~~~~~~~~~~~~~~~~~
test.cpp: In lambda function:
test.cpp:666:31: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  666 |             for (int i = 0; i < first.get_size(); ++i) {
      |                             ~~^~~~~~~~~~~~~~~~~~
test.cpp:667:35: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  667 |                 for (int j = 0; j < first.get_size(); ++j) {
      |                                 ~~^~~~~~~~~~~~~~~~~~
test.cpp:670:39: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  670 |                     for (int k = 0; k < second.get_size(); ++k) {
      |                                     ~~^~~~~~~~~~~~~~~~~~~
test.cpp:671:43: error: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  671 |                         for (int l = 0; l < second.get_size(); ++l) {
      |                                         ~~^~~~~~~~~~~~~~~~~~~

shell returned 1

Copy link
Member

@ayaankhan98 ayaankhan98 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Panquesito7 Panquesito7 added the Improvement improvement in previously written codes label Aug 27, 2021
@Panquesito7 Panquesito7 changed the title A Star Search Improvement [feat/fix]: A Star Search Improvement Aug 27, 2021
Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution! 👍 🎉

@Panquesito7 Panquesito7 added the approved Approved; waiting for merge label Aug 27, 2021
@Panquesito7 Panquesito7 merged commit 8839466 into TheAlgorithms:master Aug 27, 2021
@AshishYUO AshishYUO deleted the new-code branch September 15, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved; waiting for merge Improvement improvement in previously written codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants