Skip to content

bpo-38094: Remove unneeded assignment in PyBytes_Concat()#15274

Merged
gpshead merged 1 commit into
python:masterfrom
sir-sigurd:bytes-concat-len-1
Sep 10, 2019
Merged

bpo-38094: Remove unneeded assignment in PyBytes_Concat()#15274
gpshead merged 1 commit into
python:masterfrom
sir-sigurd:bytes-concat-len-1

Conversation

@sir-sigurd

@sir-sigurd sir-sigurd commented Aug 14, 2019

Copy link
Copy Markdown
Contributor

It looks unneeded since its introduction in 161d695

https://bugs.python.org/issue38094

It looks unneeded since its introduction in
161d695

@epicfaace epicfaace 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.

Isn't it used here:

if (oldsize > PY_SSIZE_T_MAX - wb.len) {

@sir-sigurd

Copy link
Copy Markdown
Contributor Author

When wb.len is used it's set by PyObject_GetBuffer().

@gpshead gpshead changed the title Remove unneeded assignment in PyBytes_Concat() bpo-38094: Remove unneeded assignment in PyBytes_Concat() Sep 10, 2019
@gpshead

gpshead commented Sep 10, 2019

Copy link
Copy Markdown
Member

closing and reopening to re-trigger bedevere

@gpshead gpshead closed this Sep 10, 2019
@gpshead gpshead reopened this Sep 10, 2019
@gpshead gpshead self-assigned this Sep 10, 2019
@gpshead
gpshead merged commit afdeb18 into python:master Sep 10, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @sir-sigurd for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 10, 2019
The `wb.len = -1` assignment is unneeded since its introduction in 161d695 as `PyObject_GetBuffer` always fills it in.
(cherry picked from commit afdeb18)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-15886 is a backport of this pull request to the 3.8 branch.

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @sir-sigurd for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 10, 2019
The `wb.len = -1` assignment is unneeded since its introduction in 161d695 as `PyObject_GetBuffer` always fills it in.
(cherry picked from commit afdeb18)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-15887 is a backport of this pull request to the 3.8 branch.

@sir-sigurd
sir-sigurd deleted the bytes-concat-len-1 branch September 10, 2019 16:25
miss-islington added a commit that referenced this pull request Sep 10, 2019
The `wb.len = -1` assignment is unneeded since its introduction in 161d695 as `PyObject_GetBuffer` always fills it in.
(cherry picked from commit afdeb18)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
The `wb.len = -1` assignment is unneeded since its introduction in 161d695 as `PyObject_GetBuffer` always fills it in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants