The R Project SVN R

Rev

Rev 89311 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89311 Rev 89786
Line 2446... Line 2446...
2446
    UNPROTECT(1); /* old_table */
2446
    UNPROTECT(1); /* old_table */
2447
}
2447
}
2448
 
2448
 
2449
static SEXP getcell(R_hashtab_type h, SEXP key, int *pidx)
2449
static SEXP getcell(R_hashtab_type h, SEXP key, int *pidx)
2450
{
2450
{
2451
    SEXP table = HT_TABLE(h);
-
 
2452
 
-
 
2453
    if (! HT_IS_VALID(h))
2451
    if (! HT_IS_VALID(h))
2454
	rehash(h, FALSE);
2452
	rehash(h, FALSE);
2455
 
2453
 
2456
    int idx = HT_HASH(h, key);
2454
    int idx = HT_HASH(h, key);
2457
    *pidx = idx;
2455
    *pidx = idx;
2458
 
2456
 
2459
    SEXP chain = VECTOR_ELT(table, idx);
2457
    SEXP chain = VECTOR_ELT(HT_TABLE(h), idx);
2460
    while (chain != R_NilValue) {
2458
    while (chain != R_NilValue) {
2461
	if (HT_EQUAL(h, TAG(chain), key))
2459
	if (HT_EQUAL(h, TAG(chain), key))
2462
	    return chain;
2460
	    return chain;
2463
	chain = CDR(chain);
2461
	chain = CDR(chain);
2464
    }
2462
    }