C++11 initializer lists are more elegant and easier to maintain and read. So I removed all usages of boost::assign::list_of in favor of them. Note that some of these files have never been linted before so they may have extra lint formatting changes too.
Details
make check, rpc-tests.py
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
A few changes, but that looks nice already.
src/chainparams.cpp | ||
---|---|---|
208 ↗ | (On Diff #1156) | Try to put these back in one string and see what clang format does. |
380 ↗ | (On Diff #1156) | dito |
470 ↗ | (On Diff #1156) | dito |
src/core_write.cpp | ||
63 ↗ | (On Diff #1156) | Use C++ style constructor. uint8_t(SIGHASH) It'll be much more readable. |
src/test/netbase_tests.cpp | ||
279 ↗ | (On Diff #1156) | I think you can do std::vector<uint8_t>{0} But I haven't followed the latest C++ crazyness. Also, put the comment on the line before the code. It'll get better formatting it also make blame clearer. |
287 ↗ | (On Diff #1156) | C++ style constructor instead of C style casts. |
src/test/scriptflags.cpp | ||
17 ↗ | (On Diff #1156) | Is the std::string really necessary ? |
Thanks for the feedback. I just did a quick pass to change it over -- but your readability feedback is good. I'll change it and update the revision.
src/chainparams.cpp | ||
---|---|---|
208 ↗ | (On Diff #1156) | Ok |
src/core_write.cpp | ||
63 ↗ | (On Diff #1156) | Yeah, that will look better. Good point. Will-do. |
src/test/netbase_tests.cpp | ||
279 ↗ | (On Diff #1156) | Yeah you can and it will be much more readable, good point. |
src/test/scriptflags.cpp | ||
17 ↗ | (On Diff #1156) | No, it's not. Maybe it was for boos but for this initializer list it isn't. I'll change it -- it will be more readable. I don't think the casts are necessary either. |
src/test/netbase_tests.cpp | ||
---|---|---|
287 ↗ | (On Diff #1156) | What do you think of this? Note due to the BOOST_CHECK macro, I had to do: Vec8({1,2,3,4}) rather than the more succinct: Vec8{1,2,3,4} |
src/chainparams.cpp | ||
---|---|---|
205 ↗ | (On Diff #1157) | Looks CCheckpointData would deserve a constructor of it's own. Having objects being just bags of data that anyone can manipulate is not good. But maybe that's out of the scope here. |
src/core_write.cpp | ||
63 ↗ | (On Diff #1156) | Nice, it doesn't looks like it is necessary at all. |
src/test/netbase_tests.cpp | ||
279 ↗ | (On Diff #1156) | It works. |