[mythtv] tiny code improvement.

Matt Zimmerman mdz at debian.org
Sun May 11 01:58:02 EDT 2003


On Sun, May 11, 2003 at 01:49:42PM +1000, michael at optusnet.com.au wrote:

> 2. A circular file (my made up name for it). A file that has a maximum
> file size (RingBuffer::filesize) that when reading and writing, you
> need to loop back to the beginning.

A more common name would be "ring buffer".

> A better solution might to be say that 1 (normalfile) is just a
> special case of 2 (circularfile) where the filesize happens to be
> 1000TB. (I.e. ridiculously large). This will shrink the code size as
> many of the checks for special cases evaporate.

That sounds significantly less straightforward than the existing code.
It might be better to think about reorganizing it into two classes with an
inheritance relationship, if it is possible to share the common code in a
more natural way.

-- 
 - mdz


More information about the mythtv-dev mailing list