Skip to content

Remove redundant work when validating unary Connect response#683

Merged
mattrobenolt merged 1 commit intoconnectrpc:mainfrom
mattrobenolt:optimize-connect-unary-validate
Feb 9, 2024
Merged

Remove redundant work when validating unary Connect response#683
mattrobenolt merged 1 commit intoconnectrpc:mainfrom
mattrobenolt:optimize-connect-unary-validate

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
Contributor

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

3 participants