revert faulty changes

This commit is contained in:
Niels Lohmann 2020-05-16 12:56:18 +02:00
parent bc1886fb60
commit 3ed059f6ff
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 4 additions and 8 deletions

View file

@ -630,9 +630,7 @@ class binary_writer
// step 1.5: if this is an ext type, write the subtype
if (use_ext)
{
std::uint8_t subtype;
write_number(subtype);
j.m_value.binary->set_subtype(subtype);
write_number(j.m_value.binary->subtype());
}
// step 2: write the byte string
@ -1087,7 +1085,7 @@ class binary_writer
write_bson_entry_header(name, 0x05);
write_number<std::int32_t, true>(static_cast<std::int32_t>(value.size()));
write_number(value.has_subtype() ? value.subtype() : 0x00);
write_number(value.has_subtype() ? value.subtype() : std::uint8_t(0x00));
oa->write_characters(reinterpret_cast<const CharType*>(value.data()), value.size());
}

View file

@ -12637,9 +12637,7 @@ class binary_writer
// step 1.5: if this is an ext type, write the subtype
if (use_ext)
{
std::uint8_t subtype;
write_number(subtype);
j.m_value.binary->set_subtype(subtype);
write_number(j.m_value.binary->subtype());
}
// step 2: write the byte string
@ -13094,7 +13092,7 @@ class binary_writer
write_bson_entry_header(name, 0x05);
write_number<std::int32_t, true>(static_cast<std::int32_t>(value.size()));
write_number(value.has_subtype() ? value.subtype() : 0x00);
write_number(value.has_subtype() ? value.subtype() : std::uint8_t(0x00));
oa->write_characters(reinterpret_cast<const CharType*>(value.data()), value.size());
}