gaussianrecurrence commented on a change in pull request #806:
URL: https://github.com/apache/geode-native/pull/806#discussion_r662171627
##########
File path: cppcache/src/PdxLocalWriter.cpp
##########
@@ -330,13 +330,13 @@ PdxWriter& PdxLocalWriter::markIdentityField(const
std::string&) {
return *this;
}
-uint8_t* PdxLocalWriter::getPdxStream(int& pdxLen) {
- uint8_t* stPos =
+std::vector<uint8_t> PdxLocalWriter::getPdxStream() {
+ uint8_t* buffer =
const_cast<uint8_t*>(m_dataOutput->getBuffer()) + m_startPositionOffset;
- int len = PdxHelper::readInt32 /*readByte*/ (stPos);
- pdxLen = len;
- // ignore len and typeid
- return m_dataOutput->getBufferCopyFrom(stPos + 8, len);
+ int32_t len = PdxHelper::readInt32(buffer);
+ buffer += 8;
+
+ return {buffer, buffer + len};
Review comment:
You've got a pretty good point. I think I'll use the explicit
construction, rather than the implicit, so it's more clear what's happening
there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]