link-grammar-5.8.0/link-grammar/parse/fast-match.c
/**
 * Match the lower-case parts of connectors, and the head-dependent,
 * using a cache of the most recent compare.  Due to the way disjuncts
 * are written, we are often asked to compare to the same connector
 * 3 or 4 times in a row. So if we already did that compare, just use
 * the cached result. (i.e. the caching here is almost trivial, but it
 * works well).
 */
Match the lower-case parts of connectors, and the head-dependent,
using a cache of the most recent compare.  Due to the way disjuncts
are written, we are often asked to compare to the same connector
3 or 4 times in a row. So if we already did that compare, just use
the cached result.
Match the lower - case parts of connectors and the head - dependent using a cache of the most recent compare . Due to the way disjuncts are written we are often asked to compare to the same connector 3 or 4 times in a row . So if we already did that compare just use the cached result .
static bool do_match_with_cache(Connector *a, Connector *b, match_cache *c_con)
{
	match_stats(c_con->string == a->string ? NULL : a, NULL);
	UNREACHABLE(connector_desc(a) == NULL); 
	if (c_con->desc == connector_desc(a))
	{
		PRAGMA_MAYBE_UNINITIALIZED
		return c_con->match;
		PRAGMA_END
	}
	c_con->match = lc_easy_match(connector_desc(a), connector_desc(b));
	c_con->desc = connector_desc(a);
	return c_con->match;
}
static bool do_match_with_cache ( Connector * a , Connector * b , match_cache * c_con ) { match_stats ( c_con -> string == a -> string ? NULL : a , NULL ) ; UNREACHABLE ( connector_desc ( a ) == NULL ) ; if ( c_con -> desc == connector_desc ( a ) ) { PRAGMA_MAYBE_UNINITIALIZED return c_con -> match ; PRAGMA_END } c_con -> match = lc_easy_match ( connector_desc ( a ) , connector_desc ( b ) ) ; c_con -> desc = connector_desc ( a ) ; return c_con -> match ; }
Match the lower-case parts of connectors, and the head-dependent,
 using a cache of the most recent compare.
Match the lower - case parts of connectors and the head - dependent using a cache of the most recent compare .
/* The following uses a string-set compare - string_set_cmp() cannot
	 * be used here because c_con->string may be NULL. */ // clang static analyzer suppression. /* The match_cache desc field is initialized to NULL, and this is
		 * enough because the connector desc field cannot be NULL, as it
		 * actually fetched a non-empty match list. */ /* No cache match. Check if the connectors match and cache the result.
	 * We know that the uc parts of the connectors are the same, because
	 * we fetch the matching lists according to the uc part or the
	 * connectors to be matched. So the uc parts are not checked here. */