Skip to content

Commit 7bca70d

Browse files
committed
complete corrections
1 parent 5257423 commit 7bca70d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,11 @@ SEXP nano_decode(unsigned char *buf, const size_t sz, const int mod, const int k
162162
SEXP out;
163163
const char *names[] = {"raw", "data", ""};
164164
PROTECT(data);
165-
switch (mod) {
166-
case 1:
165+
if (mod == 1) {
167166
PROTECT(raw);
168-
break;
169-
case 8:
167+
} else if (mod == 8) {
170168
PROTECT(raw = data);
171-
break;
172-
default:
169+
} else {
173170
PROTECT(raw = Rf_allocVector(RAWSXP, sz));
174171
memcpy(RAW(raw), buf, sz);
175172
}

0 commit comments

Comments
 (0)