Skip to content

Commit

Permalink
more efficient construction of Rcpp logical vector avoiding wrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Oct 31, 2024
1 parent d812039 commit df35f4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ static void later_callback(void *arg) {
if (args->func != nullptr) {
args->func(args->results->data());
} else {
Rcpp::LogicalVector results = Rcpp::wrap(*args->results);
Rcpp::LogicalVector results(args->num_fds);
std::memcpy(results.begin(), args->results->data(), args->num_fds * sizeof(int));
(*args->callback)(results);
}

Expand Down

0 comments on commit df35f4e

Please sign in to comment.