Skip to content

Commit e2247c8

Browse files
committedJun 15, 2022
child_process: add suggestion from @bnoordhuis
1 parent 24da8ae commit e2247c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎lib/internal/child_process/serialization.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ const advanced = {
7171
while (messageBufferHead.length >= 4) {
7272
// We call `readUInt32BE` manually here, because this is faster than first converting
7373
// it to a buffer and using `readUInt32BE` on that.
74-
const fullMessageSize = ReflectApply(readUInt32BE, messageBufferHead, [0]) + 4;
74+
const fullMessageSize = (
75+
messageBufferHead[0] << 24 |
76+
messageBufferHead[1] << 16 |
77+
messageBufferHead[2] << 8 |
78+
messageBufferHead[3]
79+
) + 4;
7580

7681
if (channel[kMessageBufferSize] < fullMessageSize) break;
7782

0 commit comments

Comments
 (0)