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

Remove redundant work when validating unary Connect response #683

Merged

Conversation

mattrobenolt
Copy link
Contributor

We can swap TrimPrefix for just a string slice here since we're already guarding behind HasPrefix. TrimPrefix internally runs HasPrefix again, so we can just skip the redundant work.

We can swap TrimPrefix for just a string slice here since we're already
guarding behind HasPrefix. TrimPrefix internally runs HasPrefix again,
so we can just skip the redundant work.
@mattrobenolt mattrobenolt force-pushed the optimize-connect-unary-validate branch from 5f912ee to f16e071 Compare February 8, 2024 22:53
@mattrobenolt mattrobenolt changed the title protocol_connect: remove redundant work when validating unary response Remove redundant work when validating unary Connect response Feb 8, 2024
Copy link
Member

@akshayjshah akshayjshah left a comment

Choose a reason for hiding this comment

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

Love it - thanks, Matt!

@mattrobenolt mattrobenolt merged commit 4524c7d into connectrpc:main Feb 9, 2024
11 of 12 checks passed
@mattrobenolt mattrobenolt deleted the optimize-connect-unary-validate branch February 9, 2024 00:08
@jhump jhump added the enhancement New feature or request label Feb 16, 2024
@jhump jhump mentioned this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants