-
Notifications
You must be signed in to change notification settings - Fork 36.3k
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
bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) #13383
bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) #13383
Conversation
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.
utACK b710aab38d01393412616d4a31fc4a4b3011e747
src/bench/bench_bitcoin.cpp
Outdated
@@ -9,8 +9,7 @@ | |||
#include <validation.h> | |||
#include <util.h> | |||
#include <random.h> | |||
|
|||
#include <boost/lexical_cast.hpp> | |||
#include <utilstrencodings.h> |
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.
nit: Can run the clang format diff script to sort includes
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.
Thanks! Fixed!
…exical_cast<double>(...)
b710aab
to
f41d339
Compare
How tf did Thank you for noticing, and using the function that was created for that purpose. utACK f41d339 |
…owing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
…st dependencies 81bbd32 build: Guard against accidental introduction of new Boost dependencies (practicalswift) Pull request description: Guard against accidental introduction of new Boost dependencies. Context: #13383 – the usage of `boost::lexical_cast` was introduced in #11517 from December 2017 Tree-SHA512: 8d7b667ecf7ea62d84d9d41a71726f1e46c5a411b5a7db475c973ef364cac65609399afda7931e143a27d40c2947ff286e5e98ab263e8f0d225e2ae2c0872935
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…exical_cast<double>(...) Summary: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Backport of Bitcoin Core PR13383 bitcoin/bitcoin#13383 Test Plan: ``` make check-all ``` Reviewers: Fabien, #bitcoin_abc, deadalnix, nakihito Reviewed By: #bitcoin_abc, deadalnix, nakihito Differential Revision: https://reviews.bitcoinabc.org/D4080
…new Boost dependencies 81bbd32 build: Guard against accidental introduction of new Boost dependencies (practicalswift) Pull request description: Guard against accidental introduction of new Boost dependencies. Context: bitcoin#13383 – the usage of `boost::lexical_cast` was introduced in bitcoin#11517 from December 2017 Tree-SHA512: 8d7b667ecf7ea62d84d9d41a71726f1e46c5a411b5a7db475c973ef364cac65609399afda7931e143a27d40c2947ff286e5e98ab263e8f0d225e2ae2c0872935
…new Boost dependencies 81bbd32 build: Guard against accidental introduction of new Boost dependencies (practicalswift) Pull request description: Guard against accidental introduction of new Boost dependencies. Context: bitcoin#13383 – the usage of `boost::lexical_cast` was introduced in bitcoin#11517 from December 2017 Tree-SHA512: 8d7b667ecf7ea62d84d9d41a71726f1e46c5a411b5a7db475c973ef364cac65609399afda7931e143a27d40c2947ff286e5e98ab263e8f0d225e2ae2c0872935
… of throwing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
… of throwing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
… of throwing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
… of throwing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
… of throwing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
ad5717d Lint: Add lint-includes.sh (Fuzzbawls) faba3f6 [tests] Use FastRandomContext in scheduler_tests.cpp (practicalswift) 2034bf6 Remove unused boost includes in reverselock_tests.cpp (Fuzzbawls) 3256d16 bench: Use non-throwing ParseDouble() (Fuzzbawls) 3c984d1 Remove duplicate includes (Fuzzbawls) b54e396 Declare TorReply parsing functions in torcontrol_tests (Fuzzbawls) Pull request description: This brings in the `lint-includes.sh` shell script from upstream (first introduced in bitcoin#11878) to automatically check for duplicate includes and expanded in bitcoin#13301 and bitcoin#13385 to check for the inclusion of `.cpp` files and the introduction of new boost includes, respectively. The check for enforcing bracket include syntax (bitcoin#13230) is also included, but currently disabled, as we have yet to systematically switch to that syntax preference. Three other upstream PRs are backported here as they are directly related to the removal of some boost dependencies and are very straight forward: - bitcoin#10547 - bitcoin#13291 - bitcoin#13383 **NOTE: #2711 removes the dependency on `boost/tuple/tuple.hpp`, so it makes sense to merge that first. submitting this now so the general concept/functionality can be reviewed prior to that PR being merged** ACKs for top commit: furszy: good ACK ad5717d random-zebra: utACK ad5717d and merging... Tree-SHA512: d9d32d6d5122dac52c9601cda75612d87c4e027c6f196a2382206b227fcfd2bb61d4f72df7cbf5e572d94150ad8ca6db6301bd99b0da647b9627fe342b66873f
…new Boost dependencies 81bbd32 build: Guard against accidental introduction of new Boost dependencies (practicalswift) Pull request description: Guard against accidental introduction of new Boost dependencies. Context: bitcoin#13383 – the usage of `boost::lexical_cast` was introduced in bitcoin#11517 from December 2017 Tree-SHA512: 8d7b667ecf7ea62d84d9d41a71726f1e46c5a411b5a7db475c973ef364cac65609399afda7931e143a27d40c2947ff286e5e98ab263e8f0d225e2ae2c0872935
… of throwing boost::lexical_cast<double>(...) f41d339 bench: Use non-throwing ParseDouble(...) instead of throwing boost::lexical_cast<double>(...) (practicalswift) Pull request description: * Non-Boost is better than Boost. * Non-throwing is better than throwing. * Explicit error handling is better than implicit error handling. * `ParseDouble(…)` deserves to be used outside of its unit tests :-) Tree-SHA512: a8cf04a5f8363cb7ced0bcaf1fed00e1e5dd6a63a6c11e5f0ba4e5c845b0df7c2b050d887075f158cd62dc7e02843ecaafc15e42e383c066461c6d7399e06b49
ParseDouble(…)
deserves to be used outside of its unit tests :-)