small optimization for rle encode/decode