Skip to content

Commit

Permalink
fixes collect_aio() creates empty names on list of Aios
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Aug 4, 2024
1 parent 2a58df5 commit a9b6a8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nanonext
Type: Package
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
Version: 1.1.1.9015
Version: 1.1.1.9016
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
a socket library implementing 'Scalability Protocols', a reliable,
high-performance standard for common communications patterns including
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nanonext 1.1.1.9015 (development)
# nanonext 1.1.1.9016 (development)

#### New Features

Expand All @@ -12,6 +12,7 @@

* Send mode 'next' is folded into the default 'serial', with custom serialization functions applying automatically if they have been registered.
* The session-wide `next_config()` is now deprecated and defunct, in favour of the new `serial_config()`.
* `collect_aio()` and `collect_aio_()` no longer append empty names when acting on lists of Aios where there were none in the first place.
* Removes hard dependency on `stats` and `utils` base packages.
* Requires R >= 3.6.

Expand Down
6 changes: 4 additions & 2 deletions src/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static SEXP rnng_aio_collect_impl(SEXP x, SEXP (*const func)(SEXP)) {
if (out == R_UnboundValue) break;
goto resume;
case VECSXP: ;
SEXP env;
SEXP env, names;
const R_xlen_t xlen = Rf_xlength(x);
PROTECT(out = Rf_allocVector(VECSXP, xlen));
for (R_xlen_t i = 0; i < xlen; i++) {
Expand All @@ -297,7 +297,9 @@ static SEXP rnng_aio_collect_impl(SEXP x, SEXP (*const func)(SEXP)) {
if (env == R_UnboundValue) goto exit;
SET_VECTOR_ELT(out, i, env);
}
out = Rf_namesgets(out, Rf_getAttrib(x, R_NamesSymbol));
names = Rf_getAttrib(x, R_NamesSymbol);
if (names != R_NilValue)
out = Rf_namesgets(out, names);
UNPROTECT(1);
goto resume;
}
Expand Down

0 comments on commit a9b6a8b

Please sign in to comment.