Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8682/490fca61 backport][3.11] Reduce WebSocket frame parser complexity #8728

Conversation

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented Aug 17, 2024

This is a backport of PR #8682 as merged into master (490fca6).

What do these changes do?

Small improvement to reduce the WebSocket frame parser complexity

  • Use identity checks instead of equality checks for the enums.
  • The length changes that trigger a break have been turned into guards to avoid all the indent to make a code a bit more readable.
  • The duplicate code in read payload length has been removed to improve maintainability

Are there changes in behavior for the user?

no

Is it a substantial burden for the maintainers to support this?

code is a bit easier to follow/maintain.

@bdraco bdraco enabled auto-merge (squash) August 17, 2024 13:53
Copy link

codecov bot commented Aug 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.69%. Comparing base (c6c36a6) to head (3ab6056).
Report is 18 commits behind head on 3.11.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.11    #8728      +/-   ##
==========================================
+ Coverage   96.45%   97.69%   +1.23%     
==========================================
  Files         108      108              
  Lines       34060    34086      +26     
  Branches     2166     4057    +1891     
==========================================
+ Hits        32853    33299     +446     
+ Misses        943      587     -356     
+ Partials      264      200      -64     
Flag Coverage Δ
CI-GHA 97.58% <98.24%> (+1.13%) ⬆️
OS-Linux 97.26% <98.24%> (+0.80%) ⬆️
OS-Windows 94.79% <98.24%> (?)
OS-macOS 96.93% <98.24%> (?)
Py-3.10.11 97.03% <98.24%> (?)
Py-3.10.14 96.97% <98.24%> (?)
Py-3.11.9 97.21% <98.24%> (?)
Py-3.12.4 97.30% <98.24%> (?)
Py-3.8.10 94.43% <98.24%> (?)
Py-3.8.18 96.79% <98.24%> (?)
Py-3.9.13 96.94% <98.24%> (?)
Py-3.9.19 96.89% <98.24%> (?)
Py-pypy7.3.16 96.48% <98.24%> (+0.02%) ⬆️
VM-macos 96.93% <98.24%> (?)
VM-ubuntu 97.26% <98.24%> (+0.80%) ⬆️
VM-windows 94.79% <98.24%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco merged commit 4467da3 into 3.11 Aug 17, 2024
32 of 33 checks passed
@bdraco bdraco deleted the patchback/backports/3.11/490fca61815680a0da99b92b72484c4a14779747/pr-8682 branch August 17, 2024 14:43
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.

1 participant