Skip to content

Commit 24f8d05

Browse files
committed
initialize via no_init(n)
1 parent eef1c40 commit 24f8d05

File tree

1 file changed

+2
-2
lines changed
  • inst/include/Rcpp/sugar/functions

1 file changed

+2
-2
lines changed

inst/include/Rcpp/sugar/functions/sample.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ inline Vector<INTSXP> EmpiricalSample(int n, int size, bool replace, bool one_ba
348348
return ans;
349349
}
350350

351-
IntegerVector x(n);
351+
IntegerVector x = no_init(n);
352352
for (int i = 0; i < n; i++) {
353353
x[i] = i;
354354
}
@@ -378,7 +378,7 @@ inline Vector<RTYPE> EmpiricalSample(int size, bool replace, const Vector<RTYPE>
378378
return ans;
379379
}
380380

381-
IntegerVector x(n);
381+
IntegerVector x = no_init(n);
382382
for (int i = 0; i < n; i++) {
383383
x[i] = i;
384384
}

0 commit comments

Comments
 (0)