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 unused variables in JSON-parsing code #8627

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

jameslamb
Copy link
Contributor

@jameslamb jameslamb commented Dec 28, 2022

Proposes removing two unused variables in src/common/json.cc. Hopefully this will cut a bit of processing time and a some unnecessary allocations out of JSON-reading operations.

Notes for Reviewers

I found these by running cppcheck over the project's source code.

cppcheck \
    --force \
    --enable=all \
    --std=c++14 \
    -I include/ \
    -UDEBUG \
    src/ \
> cppcheck.txt 2>&1

cat cppcheck.txt | grep 'unusedVar'

These are the only two such warnings cppcheck found.

src/common/json.cc:440:22: style: Unused variable: output [unusedVariable]
src/common/json.cc:659:15: style: Unused variable: buffer [unusedVariable]

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

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

Apologies for the slow response and thank you for the cleanup!

@trivialfis trivialfis merged commit fa44a33 into dmlc:master Jan 4, 2023
@jameslamb jameslamb deleted the remove-unused-variables branch January 18, 2023 02:31
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.

2 participants