Skip to content

Commit c41127a

Browse files
authored
Reverting changes for rfunStr & adjusting for direct use of rfunNames (defined in froll.c & extern in data.table.h)
1 parent 077e638 commit c41127a

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/frolladaptive.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,9 @@
88
* recalculate whole fun for each observation, for mean roundoff correction is adjusted
99
*/
1010
void frolladaptivefun(rollfun_t rfun, unsigned int algo, const double *x, uint64_t nx, ans_t *ans, const int *k, double fill, bool narm, int hasnf, bool verbose) {
11-
1211
double tic = 0;
13-
char rfunStr[7];
14-
15-
// enum ordered based from the file src/data.table.h
16-
const char *rfunNames[] = {
17-
"MEAN", "SUM", "MAX", "MIN", "PROD", "MEDIAN", "VAR", "SD"};
18-
19-
if (verbose){
12+
if (verbose)
2013
tic = omp_get_wtime();
21-
snprintf(rfunStr, sizeof(rfunStr), "%s", rfunNames[rfun]);
22-
}
23-
2414
switch (rfun) {
2515
case MEAN :
2616
if (algo==0) {
@@ -89,8 +79,8 @@ void frolladaptivefun(rollfun_t rfun, unsigned int algo, const double *x, uint64
8979
default: // # nocov
9080
internal_error(__func__, "Unknown rfun value in frolladaptive: %d", rfun); // # nocov
9181
}
92-
if (verbose) {
93-
snprintf(end(ans->message[0]), 500, _("%s: processing fun %s algo %s took %.3fs\n"), __func__, rfunStr, (algo == 0) ? "fast" : "exact", omp_get_wtime()-tic);
82+
if (verbose)
83+
snprintf(end(ans->message[0]), 500, _("%s: processing fun %s algo %s took %.3fs\n"), __func__, rfunNames[rfun], (algo == 0) ? "fast" : "exact", omp_get_wtime()-tic);
9484
}
9585

9686

0 commit comments

Comments
 (0)