link-grammar-5.8.0/link-grammar/parse/count.c
/** returns the pointer to this info, NULL if not there */
returns the pointer to this info, NULL if not there
returns the pointer to this info NULL if not there
static Table_connector *
find_table_pointer(count_context_t *ctxt,
                   int lw, int rw,
                   const Connector *le, const Connector *re,
                   unsigned int null_count)
{
	int l_id = (NULL != le) ? le->tracon_id : lw;
	int r_id = (NULL != re) ? re->tracon_id : rw;
	unsigned int h = pair_hash(ctxt->table_size, lw, rw, l_id, r_id, null_count);
	Table_connector *t = ctxt->table[h];
	for (; t != NULL; t = t->next)
	{
		if ((t->l_id == l_id) && (t->r_id == r_id) &&
		    (t->null_count == null_count))
		{
			DEBUG_TABLE_STAT(hit++);
			return t;
		}
	}
	DEBUG_TABLE_STAT(miss++);
	return NULL;
}
static Table_connector * find_table_pointer ( count_context_t * ctxt , int lw , int rw , const Connector * le , const Connector * re , unsigned int null_count ) { int l_id = ( NULL != le ) ? le -> tracon_id : lw ; int r_id = ( NULL != re ) ? re -> tracon_id : rw ; unsigned int h = pair_hash ( ctxt -> table_size , lw , rw , l_id , r_id , null_count ) ; Table_connector * t = ctxt -> table [ h ] ; for ( ; t != NULL ; t = t -> next ) { if ( ( t -> l_id == l_id ) && ( t -> r_id == r_id ) && ( t -> null_count == null_count ) ) { DEBUG_TABLE_STAT ( hit ++ ) ; return t ; } } DEBUG_TABLE_STAT ( miss ++ ) ; return NULL ; }
returns the pointer to this info, NULL if not there
returns the pointer to this info NULL if not there