Skip to content

Commit

Permalink
fix ci static analysis error
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Apr 4, 2022
1 parent 23827d1 commit 7e93119
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/nlohmann/detail/output/binary_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,9 @@ class binary_writer
return ubjson_prefix(v, use_bjdata) == first_prefix;
});

if (same_prefix && !(use_bjdata && std::string("[{SHTFNZ").find(static_cast<char>(first_prefix)) != std::string::npos))
std::vector<CharType> bjdx = {'[', '{', 'S', 'H', 'T', 'F', 'N', 'Z'}; // excluded markers in bjdata optimized type

if (same_prefix && !(use_bjdata && std::find(bjdx.begin(), bjdx.end(), first_prefix) != bjdx.end()))
{
prefix_required = false;
oa->write_character(to_char_type('$'));
Expand Down
4 changes: 3 additions & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14543,7 +14543,9 @@ class binary_writer
return ubjson_prefix(v, use_bjdata) == first_prefix;
});

if (same_prefix && !(use_bjdata && std::string("[{SHTFNZ").find(static_cast<char>(first_prefix)) != std::string::npos))
std::vector<CharType> bjdx = {'[', '{', 'S', 'H', 'T', 'F', 'N', 'Z'}; // excluded markers in bjdata optimized type

if (same_prefix && !(use_bjdata && std::find(bjdx.begin(), bjdx.end(), first_prefix) != bjdx.end()))
{
prefix_required = false;
oa->write_character(to_char_type('$'));
Expand Down

0 comments on commit 7e93119

Please sign in to comment.