@@ -92,11 +92,11 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
9292 double nextTime = (showProgress ) ? startTime + 3 : 0 ; // wait 3 seconds before printing progress
9393
9494 defineVar (sym_BY , BY = PROTECT (allocVector (VECSXP , ngrpcols )), env ); nprotect ++ ; // PROTECT for rchk
95- SEXP bynames = PROTECT (allocVector (STRSXP , ngrpcols )); nprotect ++ ; // TO DO : do we really need bynames, can we assign names afterwards in one step?
95+ SEXP bynames = PROTECT (allocVector (STRSXP , ngrpcols )); nprotect ++ ; // todo : do we really need bynames, can we assign names afterwards in one step?
9696 for (int i = 0 ; i < ngrpcols ; ++ i ) {
9797 int j = INTEGER (grpcols )[i ]- 1 ;
9898 SET_VECTOR_ELT (BY , i , allocVector (TYPEOF (VECTOR_ELT (groups , j )),
99- nrowgroups ? 1 : 0 )); // TODO : might be able to be 1 always but 0 when 'groups' are integer(0) seem sensible. #2440 was involved in the past.
99+ nrowgroups ? 1 : 0 )); // todo : might be able to be 1 always but 0 when 'groups' are integer(0) seem sensible. #2440 was involved in the past.
100100 // Fix for #36, by cols with attributes when also used in `j` lost the attribute.
101101 copyMostAttrib (VECTOR_ELT (groups , j ), VECTOR_ELT (BY ,i )); // not names, otherwise test 778 would fail
102102 SET_STRING_ELT (bynames , i , STRING_ELT (getAttrib (groups ,R_NamesSymbol ), j ));
@@ -109,7 +109,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
109109 R_LockBinding (sym_BY , env );
110110 if (isNull (jiscols ) && (length (bynames )!= length (groups ) || length (bynames )!= length (grpcols )))
111111 error ("!length(bynames)[%d]==length(groups)[%d]==length(grpcols)[%d]" , length (bynames ), length (groups ), length (grpcols )); // # notranslate
112- // TO DO : check this check above.
112+ // todo : check this check above.
113113
114114 N = PROTECT (findVar (install (".N" ), env )); nprotect ++ ; // PROTECT for rchk
115115 SET_TRUELENGTH (N , -1 ); // marker for anySpecialStatic(); see its comments
@@ -183,7 +183,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
183183 // Previously had replaced (i>0 || !isNull(lhs)) with i>0 to fix #49
184184 // The above is now to fix #1993, see test 1746.
185185 // In cases were no i rows match, '|| estn>-1' ensures that the last empty group creates an empty result.
186- // TODO : revisit and tidy
186+ // todo : revisit and tidy
187187
188188 if (!isNull (lhs ) &&
189189 (istarts [i ] == NA_INTEGER ||
@@ -227,7 +227,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
227227 // Or in the words, this entire section, and this entire dogroups.c file, is now write-barrier compliant from v1.12.10
228228 // and we hope that reference counting on by default from R 4.0 will avoid costly gc()s.
229229 }
230- grpn = 1 ; // it may not be 1 e.g. test 722. TODO : revisit.
230+ grpn = 1 ; // it may not be 1 e.g. test 722. todo : revisit.
231231 SETLENGTH (I , grpn );
232232 INTEGER (I )[0 ] = 0 ;
233233 for (int j = 0 ; j < length (xSD ); ++ j ) {
@@ -361,7 +361,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
361361 estn = 0 ;
362362 for (int j = 0 ; j < LENGTH (lens ); ++ j ) estn += ilens [j ];
363363 // Common case 2 : j returns as many rows as there are in the group (maybe a join)
364- // TO DO : this might over allocate if first group has 1 row and j is actually a single row aggregate
364+ // todo : this might over allocate if first group has 1 row and j is actually a single row aggregate
365365 // in cases when we're not sure could wait for the first few groups before deciding.
366366 } else // maxn < grpn
367367 estn = maxn * LENGTH (starts );
@@ -463,7 +463,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
463463 if (firstalloc ) {
464464 nprotect ++ ; // remember the first jval. If we UNPROTECTed now, we'd unprotect
465465 firstalloc = FALSE; // ans. The first jval is needed to create the right size and type of ans.
466- // TO DO : could avoid this last 'if' by adding a dummy PROTECT after first alloc for this UNPROTECT(1) to do.
466+ // todo : could avoid this last 'if' by adding a dummy PROTECT after first alloc for this UNPROTECT(1) to do.
467467 }
468468 else UNPROTECT (1 ); // the jval. Don't want them to build up. The first jval can stay protected till the end ok.
469469 }
@@ -479,7 +479,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
479479 if (verbose ) Rprintf (_ ("Wrote less rows (%d) than allocated (%d).\n" ),ansloc ,LENGTH (VECTOR_ELT (ans ,0 )));
480480 for (int j = 0 ; j < length (ans ); j ++ ) SET_VECTOR_ELT (ans , j , growVector (VECTOR_ELT (ans ,j ), ansloc ));
481481 // shrinks (misuse of word 'grow') back to the rows written, otherwise leak until ...
482- // ... TO DO : set truelength to LENGTH(VECTOR_ELT(ans,0)), length to ansloc and enhance finalizer to handle over-allocated rows.
482+ // ... todo : set truelength to LENGTH(VECTOR_ELT(ans,0)), length to ansloc and enhance finalizer to handle over-allocated rows.
483483 }
484484 } else ans = R_NilValue ;
485485 // Now reset length of .SD columns and .I to length of largest group, otherwise leak if the last group is smaller (often is).
@@ -533,7 +533,7 @@ SEXP growVector(SEXP x, const R_len_t newlen)
533533 SEXP newx ;
534534 R_len_t len = length (x );
535535 if (isNull (x )) error (_ ("growVector passed NULL" ));
536- PROTECT (newx = allocVector (TYPEOF (x ), newlen )); // TO DO : R_realloc(?) here?
536+ PROTECT (newx = allocVector (TYPEOF (x ), newlen )); // todo : R_realloc(?) here?
537537 if (newlen < len ) len = newlen ; // i.e. shrink
538538 if (!len ) { // cannot memcpy invalid pointer, #6819
539539 keepattr (newx , x );
0 commit comments