Skip to content

Use bytearray instead of BytesIO in MspDecoder - #9877

Open
radarhere wants to merge 2 commits into
python-pillow:mainfrom
radarhere:msp_variable
Open

Use bytearray instead of BytesIO in MspDecoder#9877
radarhere wants to merge 2 commits into
python-pillow:mainfrom
radarhere:msp_variable

Conversation

@radarhere

Copy link
Copy Markdown
Member
  1. When iterating through rows, the row index is assigned to x

    for x, rowlen in enumerate(rowmap):

    y would seem to be the correct choice instead.

  2. MspDecoder writes to a io.BytesIO instance, only to retrieve the value from it once done. Using bytearray() would be simpler.

@akx akx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. bytearray and BytesIO seem to use the exact same mechanism for figuring out how much to grow the backing array with, so that's not making a difference here.

Not that I imagine Windows 1 and 2 Paint images to generally be very large 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants