Fix serialization of bool sequence/array

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-08-16 15:07:47 +02:00 committed by eboasson
parent 874ac51aff
commit b49dd0eb62

View file

@ -224,7 +224,9 @@ public:
inline void deserialize (std::vector<bool>& x) { inline void deserialize (std::vector<bool>& x) {
const uint32_t sz = deserialize32 (); const uint32_t sz = deserialize32 ();
x.resize (sz); x.resize (sz);
for (auto&& i : x) i = ((data + pos)[i] != 0); for (size_t i = 0; i < sz; i++) {
x[i] = ((data + pos)[i] != 0);
}
pos += sz; pos += sz;
} }
template<class T, size_t S> inline void deserialize (std::array<T, S>& x) { template<class T, size_t S> inline void deserialize (std::array<T, S>& x) {