Skip to content

Commit f5053a0

Browse files
committed
reverted changes
1 parent fb00a95 commit f5053a0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/fsort.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ static void dinsert(double *x, const int n) { // TODO: if and when twiddled, d
1818

1919
static uint64_t minULL;
2020

21-
static void dradix_r( // single-threaded recursive worker
22-
double * restrict in, // n doubles to be sorted
23-
double * restrict working, // working memory to put the sorted items before copying over *in; must not overlap *in
24-
uint64_t n, // number of items to sort. *in and *working must be at least n long
25-
int fromBit, // After twiddle to ordered ull, the bits [fromBit,toBit] are used to count
26-
int toBit, // fromBit<toBit; bit 0 is the least significant; fromBit is right shift amount too
27-
uint64_t * restrict counts // already zero'd counts vector, 2^(toBit-fromBit+1) long. A stack of these is reused.
21+
static void dradix_r( // single-threaded recursive worker
22+
double *in, // n doubles to be sorted
23+
double *working, // working memory to put the sorted items before copying over *in; must not overlap *in
24+
uint64_t n, // number of items to sort. *in and *working must be at least n long
25+
int fromBit, // After twiddle to ordered ull, the bits [fromBit,toBit] are used to count
26+
int toBit, // fromBit<toBit; bit 0 is the least significant; fromBit is right shift amount too
27+
uint64_t *counts // already zero'd counts vector, 2^(toBit-fromBit+1) long. A stack of these is reused.
2828
) {
2929
uint64_t width = 1ULL<<(toBit-fromBit+1);
3030
uint64_t mask = width-1;
@@ -347,4 +347,3 @@ SEXP fsort(SEXP x, SEXP verboseArg) {
347347
UNPROTECT(nprotect);
348348
return(ansVec);
349349
}
350-

src/fwriteR.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,16 @@ static int32_t whichWriter(SEXP);
7575

7676
void writeList(const void *col, int64_t row, char **pch) {
7777
SEXP v = ((const SEXP *)col)[row];
78-
const int32_t wf = whichWriter(v);
78+
int32_t wf = whichWriter(v);
7979
if (TYPEOF(v)==VECSXP || wf==INT32_MIN || isFactor(v)) {
8080
internal_error(__func__, "TYPEOF(v)!=VECSXP && wf!=INT32_MIN && !isFactor(v); getMaxListItem should have caught this up front"); // # nocov
8181
}
8282
char *ch = *pch;
8383
write_chars(sep2start, &ch);
8484
const void *data = DATAPTR_RO(v);
85+
writer_fun_t *fun = funs[wf];
8586
for (int j=0; j<LENGTH(v); j++) {
86-
funs[wf](data, j, &ch);
87+
(*fun)(data, j, &ch);
8788
*ch++ = sep2;
8889
}
8990
if (LENGTH(v)) ch--; // backup over the last sep2 after the last item
@@ -310,4 +311,4 @@ SEXP fwriteR(
310311

311312
UNPROTECT(protecti);
312313
return(R_NilValue);
313-
}
314+
}

0 commit comments

Comments
 (0)