brisbane: groupcompress cleanups - part1
Ian Clatworthy
ian.clatworthy at internode.on.net
Tue Mar 31 12:28:01 BST 2009
Stephen J. Turnbull wrote:
> Ian Clatworthy writes:
> > I've spent the day doing a code review of groupcompress,
>
> A nit:
>
>
> > - if self._compressor_name == 'lzma':
> > + if self._compressor_name == 'zlib':
> > + header = zlib.decompress(self._z_header)
> > + else:
> > + if self._compressor_name != 'lzma':
> > + raise AssertionError("unknown compressor name %s" %
> > + (self._compressor_name,))
> > header = pylzma.decompress(self._z_header)
> > - else:
> > - assert self._compressor_name == 'zlib'
> > - header = zlib.decompress(self._z_header)
>
> Wouldn't
>
> if self._compressor_name == 'lzma':
> header = pylzma.decompress(self._z_header)
> elif self._compressor_name == 'zlib':
> header = zlib.decompress(self._z_header)
> else:
> raise AssertionError("unknown compressor name %s" %
> (self._compressor_name,))
>
> be clearer here?
>
It would be yes. We ought to check for zlib first though because
that's the common case.
Ian C.
More information about the bazaar
mailing list