Skip to content

Commit bd255ae

Browse files
Morel BérengerAntoine Fontaine
authored andcommitted
recvmsg: use std::fill instead of for-loop
Seems faster
1 parent 5940037 commit bd255ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/common/IPC/Primitives.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ bool InternalRecvMsg(Sys::OSHandle handle, Util::Reader& reader)
343343
recvBuffer.reset(new char[NACL_ABI_IMC_BYTES_MAX]);
344344
}
345345

346-
for (size_t i = 0; i < NACL_ABI_IMC_DESC_MAX; i++)
347-
h[i] = NACL_INVALID_HANDLE;
346+
std::fill(std::begin(h), std::end(h), NACL_INVALID_HANDLE);
348347

349348
#ifdef __native_client__
350349
hdr.iov = iov;

0 commit comments

Comments
 (0)