-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Cppcheck fixes #1760
Cppcheck fixes #1760
Conversation
binary_reader.hpp:650: (style) Unsigned expression 'mant' can't be negative so it is unnecessary to test it https://github.com/Xav83/nlohmann-json-cppcheck/commit/910a7d2b873dd7ae92ec81cced2bf73200ff4848/checks#step:5:84 Signed-off-by: Xav83 <x.jouvenot@gmail.com>
708b16a
to
1667541
Compare
d43728f
to
0605a2e
Compare
binary_writer.hpp:869: (style) Consider using std::accumulate algorithm instead of a raw loop. https://github.com/Xav83/nlohmann-json-cppcheck/commit/910a7d2b873dd7ae92ec81cced2bf73200ff4848/checks#step:5:107 Signed-off-by: Xav83 <x.jouvenot@gmail.com>
0605a2e
to
87afee1
Compare
I don't understand why the Travis job with Xcode 9.3 fails, but I found a ninja issue similar to the error message. And errors found by Code Inspector aren't referencing the code I modified. So, should I fix them or should they be fixed in another Pull Request ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
🔖 Release itemThis issue/PR will be part of the next release of the library. This template helps preparing the release notes. Type
Description
|
Thanks a lot! |
This Pull Request corrects two of the warnings reported by cppcheck, mentionned in #1759
A warning about an unnecessary check in the first commit, and a warning about a code enhancement in the second warning, by using the std::accumulate function instead of a raw loop.
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.