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

Fix the issue regarding "Clean up code: .str().length() #2577" #1

Closed
wants to merge 21 commits into from

Conversation

AnikaAChowdhury
Copy link
Owner

Submission Checklist

  • Run unit tests: ./runTests.py src/test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary

This fixes stan-dev#2577 which is cleaning up code instances that has .str().length() for logger.info(). This cleans up a lot of "if (msg.str().length() > 0)" instances from the code block that follows
if (msg.str().length() > 0)
logger.info(msg);
patterns. However, there are still a lot of instances "if (msg.str().length() > 0)" left because it was connected with another logger implementation beside logger.info(). Therefore, some of the instances of that could not be removed.

Intended Effect

Removes a lot of duplicate codes.

How to Verify

Need to run tests on the existing testing library (In Progress).

Side Effects

Followed @WardBrian's suggestions.

Documentation

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

SteveBronder and others added 21 commits January 19, 2022 20:51
Fix assign and lvalue to return 0 row/col/size objects for negative indexing
@AnikaAChowdhury AnikaAChowdhury added the good first issue Good for newcomers label Jan 28, 2022
@AnikaAChowdhury AnikaAChowdhury removed the good first issue Good for newcomers label Jan 28, 2022
@AnikaAChowdhury
Copy link
Owner Author

Submission Checklist

  • Run unit tests: ./runTests.py src/test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary

This fixes stan-dev#2577 which is cleaning up code instances that has .str().length() for logger.info(). This cleans up a lot of "if (msg.str().length() > 0)" instances from the code block that follows if (msg.str().length() > 0) logger.info(msg); patterns. However, there are still a lot of instances "if (msg.str().length() > 0)" left because it was connected with another logger implementation beside logger.info(). Therefore, some of the instances of that could not be removed.

Intended Effect

Removes a lot of duplicate codes.

How to Verify

Need to run tests on the existing testing library (In Progress).

Side Effects

Followed @WardBrian's suggestions.

Documentation

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

Note:
This is my first time creating a pull request. I am not sure if I did it in the right place or not. If I am not in the place, I will fix it soon.

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.

Clean up code: .str().length()
5 participants