[PATCH 2 of 2] Pure python base85 fallback

Dennis Brakhane brakhane at googlemail.com
Wed Dec 31 06:12:01 CST 2008


On Wed, Dec 31, 2008 at 4:00 AM, Brendan Cully <brendan at kublai.com> wrote:
> +    # Trim padding
> +    olen = l % 4
> +    if olen:
> +        olen += 1
> +    olen += l / 4 * 5
> +    return out[:olen]

Same division problem here, but I think you could simply write it as

overhead = (4-l)%4
if overhead:
  return out[:-overhead]
else:
  return out


More information about the Mercurial-devel mailing list