Skip to content

Commit 9cc8beb

Browse files
back to TOGGLE_BUMP
1 parent e6064ec commit 9cc8beb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/fread.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static void Field(FieldParseContext *ctx);
115115
// a sample of rows) winds up being incorrect when considering the
116116
// full input.
117117
#define IGNORE_BUMP(x) abs(x)
118-
#define APPLY_BUMP(x) (-x)
118+
#define TOGGLE_BUMP(x) (-x)
119119

120120
//=================================================================================================
121121
//
@@ -2495,7 +2495,7 @@ int freadMain(freadMainArgs _args) {
24952495
// sure a single re-read will definitely work.
24962496
typebump:
24972497
while (++absType<CT_STRING && disabled_parsers[absType]) {};
2498-
thisType = APPLY_BUMP(absType);
2498+
thisType = TOGGLE_BUMP(absType);
24992499
tch = fieldStart;
25002500
}
25012501

@@ -2507,7 +2507,7 @@ int freadMain(freadMainArgs _args) {
25072507
if (j+fieldsRemaining != ncol) break;
25082508
checkedNumberOfFields = true;
25092509
}
2510-
if (thisType <= APPLY_BUMP(NUMTYPE)) {
2510+
if (thisType <= TOGGLE_BUMP(NUMTYPE)) {
25112511
break; // Improperly quoted char field needs to be healed below, other columns will be filled #5041 and #4774
25122512
}
25132513
#pragma omp critical
@@ -2683,7 +2683,7 @@ int freadMain(freadMainArgs _args) {
26832683
if (firstTime) {
26842684
tReread = tRead = wallclock();
26852685

2686-
// if nTypeBump>0, not-bumped columns are about to be assigned parse type APPLY_BUMP(CT_STRING) for the reread, so we have to count
2686+
// if nTypeBump>0, not-bumped columns are about to be assigned parse type TOGGLE_BUMP(CT_STRING) for the reread, so we have to count
26872687
// parse types now (for log). We can't count final column types afterwards because many parse types map to the same column type.
26882688
for (int i=0; i<NUMTYPE; i++) typeCounts[i] = 0;
26892689
for (int i=0; i<ncol; i++) typeCounts[ IGNORE_BUMP(type[i]) ]++;
@@ -2697,7 +2697,7 @@ int freadMain(freadMainArgs _args) {
26972697
if (type[j] == CT_DROP) continue;
26982698
if (type[j]<0) {
26992699
// column was bumped due to out-of-sample type exception
2700-
type[j] = APPLY_BUMP(type[j]);
2700+
type[j] = TOGGLE_BUMP(type[j]);
27012701
size[j] = typeSize[type[j]];
27022702
rowSize1 += (size[j] & 1);
27032703
rowSize4 += (size[j] & 4);
@@ -2706,7 +2706,7 @@ int freadMain(freadMainArgs _args) {
27062706
} else if (type[j]>=1) {
27072707
// we'll skip over non-bumped columns in the rerun, whilst still incrementing resi (hence not CT_DROP)
27082708
// not -type[i] either because that would reprocess the contents of not-bumped columns wastefully
2709-
type[j] = APPLY_BUMP(CT_STRING);
2709+
type[j] = TOGGLE_BUMP(CT_STRING);
27102710
size[j] = 0;
27112711
}
27122712
}

0 commit comments

Comments
 (0)