* A variant of LookupTupleHashEntry for callers that have already computed * the hash value. */
| 369 | * the hash value. |
| 370 | */ |
| 371 | TupleHashEntry |
| 372 | LookupTupleHashEntryHash(TupleHashTable hashtable, TupleTableSlot *slot, |
| 373 | bool *isnew, uint32 hash) |
| 374 | { |
| 375 | TupleHashEntry entry; |
| 376 | MemoryContext oldContext; |
| 377 | |
| 378 | /* Need to run the hash functions in short-lived context */ |
| 379 | oldContext = MemoryContextSwitchTo(hashtable->tempcxt); |
| 380 | |
| 381 | /* set up data needed by hash and match functions */ |
| 382 | hashtable->inputslot = slot; |
| 383 | hashtable->in_hash_funcs = hashtable->tab_hash_funcs; |
| 384 | hashtable->cur_eq_func = hashtable->tab_eq_func; |
| 385 | |
| 386 | entry = LookupTupleHashEntry_internal(hashtable, slot, isnew, hash); |
| 387 | Assert(entry == NULL || entry->hash == hash); |
| 388 | |
| 389 | MemoryContextSwitchTo(oldContext); |
| 390 | |
| 391 | return entry; |
| 392 | } |
| 393 | |
| 394 | /* |
| 395 | * Search for a hashtable entry matching the given tuple. No entry is |
no test coverage detected