Skip to content

Commit ae8ba9f

Browse files
committed
RC9a; tidy-ups
1 parent cfa5e14 commit ae8ba9f

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
*Please review the following potentially breaking changes, and only update when ready:*
1010

11-
* The package now ensures stability of return types:
12-
+ `socket()` and `stream()` will now error rather than return an 'errorValue'. The error value is included in the error message.
11+
* The API has been re-engineered to ensure stability of return types:
12+
+ `socket()`, `context()` and `stream()` will now error rather than return an 'errorValue'. The error value is included in the error message.
1313
+ `send_aio()` and `recv_aio()` now always return an integer 'errorValue' at `$result` and `$data` respectively.
1414
+ `recv()` and `recv_aio()` now return an integer 'errorValue' at each of `$raw` and `$data` when 'keep.raw' is set to TRUE.
1515
+ `ncurl()` now returns an integer 'errorValue' at each of `$status`, `$headers`, `$raw` and `$data` for both sync and async. Where redirects are not followed, the address is now returned as a character string at `$data`.

src/core.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,7 @@ int nano_matchargs(SEXP mode) {
231231
if (TYPEOF(mode) == INTSXP)
232232
return INTEGER(mode)[0];
233233

234-
const char *mod;
235-
if (Rf_xlength(mode) == 8) {
236-
mod = CHAR(STRING_ELT(mode, 1));
237-
} else {
238-
mod = CHAR(STRING_ELT(mode, 0));
239-
}
240-
234+
const char *mod = Rf_xlength(mode) == 8 ? CHAR(STRING_ELT(mode, 1)) : CHAR(STRING_ELT(mode, 0));
241235
size_t slen = strlen(mod);
242236
const char ch[] = "character", co[] = "complex", d[] = "double",
243237
i[] = "integer", l[] = "logical", n[] = "numeric", r[] = "raw";

0 commit comments

Comments
 (0)