Skip to content

Commit 1384944

Browse files
HughParsonageaitap
authored andcommitted
rbindlist: initial hash size = upperBoundUniqueNames
1 parent 66ac645 commit 1384944

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rbindlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ SEXP rbindlist(SEXP l, SEXP usenamesArg, SEXP fillArg, SEXP idcolArg, SEXP ignor
7474
SEXP *uniq = malloc(sizeof(*uniq) * upperBoundUniqueNames); // upperBoundUniqueNames was initialized with 1 to ensure this is defined (otherwise 0 when no item has names)
7575
if (!uniq)
7676
error(_("Failed to allocate upper bound of %"PRId64" unique column names [sum(lapply(l,ncol))]"), (int64_t)upperBoundUniqueNames); // # nocov
77-
hashtab * marks = hash_create(1 + (LENGTH(l) ? (2 * LENGTH(getAttrib(VECTOR_ELT(l, 0), R_NamesSymbol))) : 0));
77+
hashtab * marks = hash_create(upperBoundUniqueNames);
7878
int nuniq=0;
7979
// first pass - gather unique column names
8080
for (int i=0; i<LENGTH(l); i++) {

0 commit comments

Comments
 (0)