Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Apr 8, 2021
1 parent c1b8a6c commit 51bd62d
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions lib/serialization/BinaryMiddleware.js
Expand Up @@ -114,31 +114,6 @@ const identifyNumber = n => {
* @extends {SerializerMiddleware<DeserializedType, SerializedType>}
*/
class BinaryMiddleware extends SerializerMiddleware {
static optimizeSerializedData(data) {
const result = [];
const temp = [];
const flush = () => {
if (temp.length > 0) {
if (temp.length === 1) {
result.push(temp[0]);
} else {
result.push(Buffer.concat(temp));
}
temp.length = 0;
}
};
for (const item of data) {
if (Buffer.isBuffer(item)) {
temp.push(item);
} else {
flush();
result.push(item);
}
}
flush();
return result;
}

/**
* @param {DeserializedType} data data
* @param {Object} context context object
Expand Down

0 comments on commit 51bd62d

Please sign in to comment.