nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.18k stars 6.65k forks source link

refactor(tests): use prefix instead of postfix operators #3964

Closed zEuS0390 closed 1 year ago

zEuS0390 commented 1 year ago

Using prefix operator over postfix operator when it is not used is more efficient because it only changes the current value without creating a copy of it.

nlohmann commented 1 year ago

I am currently only looking at this from my mobile, but it seems the tests call that specific operator to ensure all functions are properly tested. So it could be that this optimization could reduce test coverage.

zEuS0390 commented 1 year ago

I'm sorry, this is my first time contributing, and I didn't notice it. Well, maybe I should close this PR. Thanks!

coveralls commented 1 year ago

Coverage Status

Coverage: 100.0%. Remained the same when pulling 24bc8c91dce4058c72d39465fa0dab78ccb44799 on zEuS0390:develop into b504dca35a6aac16c4596441a78024737bcc95c0 on nlohmann:develop.