1
0
Fork 0

use the mkshared constructor

This commit is contained in:
Kevin Matz 2021-09-17 08:48:39 -04:00
parent 0afb725606
commit c30d6a33f2
1 changed files with 10 additions and 10 deletions

View File

@ -92,16 +92,16 @@ struct Block
}
void iStream(Stream s) override {
while(s->good()) {
Message<T> p(new T());
p->iStream(s);
if (s->fail()) // stream failed during pdu read
break;
if (p->stream()->fail()) // pdu buffer failed
continue;
if (!pdu->empty()) // set inheritee
p->setInherit(pdu->back());
pdu->push_back(p); // add to block
}
auto p = std::make_shared<T>();
p->iStream(s);
if (s->fail()) // stream failed during pdu read
break;
if (p->stream()->fail()) // pdu buffer failed
continue;
if (!pdu->empty()) // set inheritee
p->setInherit(pdu->back());
pdu->push_back(p); // add to block
}
}
void oStream(Stream s) const override {
for (const auto & child : *pdu)