Branch: Tag:

2000-04-14

2000-04-14 16:39:35 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

better and smaller cache in resolve()

Rev: lib/master.pike.in:1.116

1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.115 2000/04/13 18:54:05 per Exp $ +  * $Id: master.pike.in,v 1.116 2000/04/14 16:39:35 hubbe Exp $    *    * Master-file for Pike.    *
871:   mixed resolv(string identifier, string|void current_file)   {    mixed ret; -  if( !zero_type (ret = resolv_cache[identifier+current_file]) ) -  return ret == ZERO_TYPE ? UNDEFINED : resolv_cache[identifier+current_file]; +  string id=identifier+":"+(current_file ? dirname(current_file) : "-"); +  if( !zero_type (ret = resolv_cache[id]) ) +  return ret == ZERO_TYPE ? UNDEFINED : resolv_cache[id];    array(string) tmp=identifier/".";    ret=resolv_base(tmp[0]);    foreach(tmp[1..],string index) ret=ret[index]; -  resolv_cache[identifier+current_file] = zero_type (ret) ? ZERO_TYPE : ret; +  resolv_cache[id] = zero_type (ret) ? ZERO_TYPE : ret;    return ret;   }