Fix -Weffc++ in the BSON recorder test and a clang-tidy use-auto hit
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
3 files changed
+3
-3
No files matched your search
@@ -382,7 +382,7 @@ class binary_reader
|
|||||||
|
|
||||||
// the declared size bounds where the document ends: an embedded
|
// the declared size bounds where the document ends: an embedded
|
||||||
// document must end before the terminator of the document that contains it
|
// document must end before the terminator of the document that contains it
|
||||||
const std::size_t unsigned_size = static_cast<std::size_t>(document_size);
|
const auto unsigned_size = static_cast<std::size_t>(document_size);
|
||||||
const std::size_t document_end = unsigned_size > (std::numeric_limits<std::size_t>::max)() - document_start
|
const std::size_t document_end = unsigned_size > (std::numeric_limits<std::size_t>::max)() - document_start
|
||||||
? (std::numeric_limits<std::size_t>::max)()
|
? (std::numeric_limits<std::size_t>::max)()
|
||||||
: document_start + unsigned_size;
|
: document_start + unsigned_size;
|
||||||
|
|||||||
Generated
+1
-1
@@ -17849,7 +17849,7 @@ class binary_reader
|
|||||||
|
|
||||||
// the declared size bounds where the document ends: an embedded
|
// the declared size bounds where the document ends: an embedded
|
||||||
// document must end before the terminator of the document that contains it
|
// document must end before the terminator of the document that contains it
|
||||||
const std::size_t unsigned_size = static_cast<std::size_t>(document_size);
|
const auto unsigned_size = static_cast<std::size_t>(document_size);
|
||||||
const std::size_t document_end = unsigned_size > (std::numeric_limits<std::size_t>::max)() - document_start
|
const std::size_t document_end = unsigned_size > (std::numeric_limits<std::size_t>::max)() - document_start
|
||||||
? (std::numeric_limits<std::size_t>::max)()
|
? (std::numeric_limits<std::size_t>::max)()
|
||||||
: document_start + unsigned_size;
|
: document_start + unsigned_size;
|
||||||
|
|||||||
@@ -1311,7 +1311,7 @@ TEST_CASE("BSON declared document size bounds the content")
|
|||||||
// records the events that a SAX parser receives
|
// records the events that a SAX parser receives
|
||||||
struct recorder : nlohmann::json_sax<json>
|
struct recorder : nlohmann::json_sax<json>
|
||||||
{
|
{
|
||||||
std::string events;
|
std::string events {};
|
||||||
|
|
||||||
bool null() override
|
bool null() override
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user