FreeBSD/contrib/subversion/subversion/libsvn_fs_x/tree.c
/* Optimistic lookup using the last seen non-empty location in CACHE.
   Return the node of that entry, if it is still in use and matches PATH.
   Return NULL otherwise.  Since the caller usually already knows the path
   length, provide it in PATH_LEN. */
Optimistic lookup using the last seen non-empty location in CACHE.
Return the node of that entry, if it is still in use and matches PATH.
Return NULL otherwise.  Since the caller usually already knows the path
length, provide it in PATH_LEN.
Optimistic lookup using the last seen non - empty location in CACHE . Return the node of that entry if it is still in use and matches PATH . Return NULL otherwise . Since the caller usually already knows the path length provide it in PATH_LEN .
static dag_node_t *
cache_lookup_last_path(svn_fs_x__dag_cache_t *cache,
                       const char *path,
                       apr_size_t path_len)
{
  cache_entry_t *result = &cache->buckets[cache->last_non_empty];
  assert(strlen(path) == path_len);
  if (   result->node
      && (result->path_len == path_len)
      && !memcmp(result->path, path, path_len))
    {
      return result->node;
    }
  return NULL;
}
static dag_node_t * cache_lookup_last_path ( svn_fs_x__dag_cache_t * cache , const char * path , apr_size_t path_len ) { cache_entry_t * result = & cache -> buckets [ cache -> last_non_empty ] ; assert ( strlen ( path ) == path_len ) ; if ( result -> node && ( result -> path_len == path_len ) && ! memcmp ( result -> path , path , path_len ) ) { return result -> node ; } return NULL ; }
Optimistic lookup using the last seen non-empty location in CACHE.
Optimistic lookup using the last seen non - empty location in CACHE .