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

Refactor martial arts buff requirements check #52501

Merged
merged 1 commit into from
Oct 29, 2021

Conversation

BrettDong
Copy link
Member

Summary

None

Purpose of change

LGTM.com reports two empty if() blocks in ma_requirements::is_valid_character(), which is probably an oversight in #51950:
https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/snapshot/e76e68e3d1b64e04cc0ec5f9f65f001330d3a646/files/src/martialarts.cpp#x6cef958d535d15b2:1

While trying to fix the warning, I feel that this part of the code can be simplified and made more intuitive with std::any_of() and std::all_of().

Describe the solution

Refactor martial arts buff requirements check.

Describe alternatives you've considered

Testing

Additional context

@BrettDong BrettDong added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Martial Arts Arts, Techniques, weapons and anything touching martial arts. labels Oct 28, 2021
@lgtm-com
Copy link

lgtm-com bot commented Oct 28, 2021

This pull request fixes 2 alerts when merging 2dcf312 into 25d9d00 - view on LGTM.com

fixed alerts:

  • 2 for Empty branch of conditional

@kevingranade kevingranade merged commit 98d544e into CleverRaven:master Oct 29, 2021
@BrettDong BrettDong deleted the martial branch October 29, 2021 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Martial Arts Arts, Techniques, weapons and anything touching martial arts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants