Branch: Tag:

2008-11-04

2008-11-04 15:49:23 by Martin Stjernholm <mast@lysator.liu.se>

Ported fix from 7.4: Don't use variables to create function aliases. (They
don't cause garbage in 7.6 and later, but they're still slow and makes the
objects unnecessarily large.)

Rev: lib/modules/Calendar.pmod/Event.pmod:1.25
Rev: lib/modules/Calendar.pmod/Events.pmod:1.20
Rev: lib/modules/Calendar.pmod/TimeRanges.pmod:1.36
Rev: lib/modules/Calendar.pmod/Timezone.pmod:1.45

566:    offset==other->offset &&    s==other->s );    } -  function(Shift:int) __equal=`==; +  int __equal (Shift other) {return `== (other);}       constant wday=(["Mon":1,"Tue":2,"Wed":3,"Thu":4,"Fri":5,"Sat":6,"Sun":7]);    constant vmonth=(<"Jan","Feb","Mar","Apr","May","Jun",
1400:    protected int offset_to_utc;    string name;    -  protected function(string:string) tzformat; +     protected array names;      
1428:    });    }    +  protected string tzformat (string s) +  { +  if (names) +  { +  if (s=="") return names[0]; else return names[1]; +  } +  else +  return sprintf(name,s); +  } +     protected void create(int offset,string _name)    {    offset_to_utc=offset;
1435:    if (has_value(name, "/"))    {    names=name/"/"; -  tzformat=lambda(string s) -  { -  if (s=="") return names[0]; else return names[1]; -  }; +     } -  else -  tzformat=lambda(string s) { return sprintf(name,s); }; +     }      // the Rule: