Skip to content

Commit

Permalink
🔨 hid the test lambda #489
Browse files Browse the repository at this point in the history
The is_contiguous lambda is only used in an assertion, so it can be
removed if NDEBUG is defined.
  • Loading branch information
nlohmann committed Mar 11, 2017
1 parent a801d76 commit 9e232ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/json.hpp
Expand Up @@ -6969,6 +6969,7 @@ class basic_json
{
// assertion to check that the iterator range is indeed contiguous,
// see http://stackoverflow.com/a/35008842/266378 for more discussion
#ifndef NDEBUG
const auto is_contiguous = [&]()
{
bool test = true;
Expand All @@ -6979,6 +6980,7 @@ class basic_json
}
return test;
};
#endif
assert(is_contiguous());

// assertion to check that each element is 1 byte long
Expand Down
2 changes: 2 additions & 0 deletions src/json.hpp.re2c
Expand Up @@ -6969,6 +6969,7 @@ class basic_json
{
// assertion to check that the iterator range is indeed contiguous,
// see http://stackoverflow.com/a/35008842/266378 for more discussion
#ifndef NDEBUG
const auto is_contiguous = [&]()
{
bool test = true;
Expand All @@ -6979,6 +6980,7 @@ class basic_json
}
return test;
};
#endif
assert(is_contiguous());

// assertion to check that each element is 1 byte long
Expand Down

0 comments on commit 9e232ec

Please sign in to comment.