Skip to content

Commit 43aa55e

Browse files
committed
switched to memset
1 parent d875823 commit 43aa55e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/nqrecreateindices.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "data.table.h"
2+
#include <string.h>
23

34
// TODO: Add oxygen style comments and cleanup var names.
45
// See other TODOs inside the function.
@@ -17,7 +18,7 @@ SEXP nqRecreateIndices(SEXP xo, SEXP len, SEXP indices, SEXP nArg, SEXP nomatch)
1718
const int inomatch = isNull(nomatch) ? 0 : INTEGER(nomatch)[0];
1819
int *inewstarts = INTEGER(newstarts);
1920

20-
for (int i = 0; i < n; i++) inewlen[i] = 0;
21+
memset(inewlen, 0, n);
2122

2223
// simplifying logic ... also fixes #2275
2324
for (int i = 0; i < length(indices); i++) {

0 commit comments

Comments
 (0)