LRUCache - a simple least recently used cache

janderson askme at me.com
Wed Nov 7 22:39:54 PST 2007


Charles D Hixson wrote:
> 
> However I *did* take your suggestion about documenting it.
> 
> OTOH, it would be better if I could renumber the nodes sequentially, but 
> doing that without a sort is difficult (i.e., I haven't figured out how).
> 
> A different organization would be to keep nodeIds in a queue, with 
> pointers to the hash table, but that has other costs. Still, I SHOULD 
> add a routine to renumber everything whenever the maxT value starts to 
> get withing maxSize of ushort.max. This routine will probably be 
> introduced at some later version.
> 
> Any suggestions for a quick and simple way to do this?

A good form of documentation is to use contracts for this sort of thing.

-Joel



More information about the Digitalmars-d-announce mailing list