Skip to content

Commit a9b6a8b

Browse files
committed
fixes collect_aio() creates empty names on list of Aios
1 parent 2a58df5 commit a9b6a8b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: nanonext
22
Type: Package
33
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
4-
Version: 1.1.1.9015
4+
Version: 1.1.1.9016
55
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
66
a socket library implementing 'Scalability Protocols', a reliable,
77
high-performance standard for common communications patterns including

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nanonext 1.1.1.9015 (development)
1+
# nanonext 1.1.1.9016 (development)
22

33
#### New Features
44

@@ -12,6 +12,7 @@
1212

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

src/aio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static SEXP rnng_aio_collect_impl(SEXP x, SEXP (*const func)(SEXP)) {
287287
if (out == R_UnboundValue) break;
288288
goto resume;
289289
case VECSXP: ;
290-
SEXP env;
290+
SEXP env, names;
291291
const R_xlen_t xlen = Rf_xlength(x);
292292
PROTECT(out = Rf_allocVector(VECSXP, xlen));
293293
for (R_xlen_t i = 0; i < xlen; i++) {
@@ -297,7 +297,9 @@ static SEXP rnng_aio_collect_impl(SEXP x, SEXP (*const func)(SEXP)) {
297297
if (env == R_UnboundValue) goto exit;
298298
SET_VECTOR_ELT(out, i, env);
299299
}
300-
out = Rf_namesgets(out, Rf_getAttrib(x, R_NamesSymbol));
300+
names = Rf_getAttrib(x, R_NamesSymbol);
301+
if (names != R_NilValue)
302+
out = Rf_namesgets(out, names);
301303
UNPROTECT(1);
302304
goto resume;
303305
}

0 commit comments

Comments
 (0)