Skip to content

Commit 0e9875f

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

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
@@ -339,8 +339,7 @@ bool InternalRecvMsg(Sys::OSHandle handle, Util::Reader& reader)
339339
recvBuffer.reset(new char[NACL_ABI_IMC_BYTES_MAX]);
340340
}
341341

342-
for (size_t i = 0; i < NACL_ABI_IMC_DESC_MAX; i++)
343-
h[i] = NACL_INVALID_HANDLE;
342+
std::fill(std::begin(h), std::end(h), NACL_INVALID_HANDLE);
344343

345344
#ifdef __native_client__
346345
hdr.iov = iov;

0 commit comments

Comments
 (0)