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

refactor(api): Make maxConcurrentCaptures int32 to avoid cast. #105

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

domdom82
Copy link
Contributor

@domdom82 domdom82 commented Aug 4, 2023

Minor refactor. We compare maxConcurrentCaptures to concurrentStreams which should match datatypes.

@domdom82 domdom82 requested a review from a team as a code owner August 4, 2023 09:06
@domdom82 domdom82 added the run-ci Triggers PR Validation label Aug 4, 2023
@domdom82 domdom82 force-pushed the concurrent-captures-datatype branch from a2a6b25 to 94e1ad0 Compare August 4, 2023 10:10
Copy link
Member

@maxmoehl maxmoehl left a comment

Choose a reason for hiding this comment

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

I'd prefer unit32 since the value can't be negative.

@domdom82 domdom82 force-pushed the concurrent-captures-datatype branch from 94e1ad0 to 690cf06 Compare August 4, 2023 16:01
@domdom82 domdom82 requested a review from maxmoehl August 4, 2023 16:01
@domdom82 domdom82 force-pushed the concurrent-captures-datatype branch from 690cf06 to 13b7e2a Compare August 7, 2023 10:04
@domdom82
Copy link
Contributor Author

domdom82 commented Aug 7, 2023

I'd prefer unit32 since the value can't be negative.

do you mean uint32?
it's possible (as I've shown in the latest commit), however it's non-trivial to subtract from an unsigned int.
See my comment in api.go. You can't add uint32(-1) so you have to use the binary complement to do that. Not sure if it's worth the confusion this will likely cause...

@maxmoehl
Copy link
Member

maxmoehl commented Aug 7, 2023

I'd prefer unit32 since the value can't be negative.

do you mean uint32? it's possible (as I've shown in the latest commit), however it's non-trivial to subtract from an unsigned int. See my comment in api.go. You can't add uint32(-1) so you have to use the binary complement to do that. Not sure if it's worth the confusion this will likely cause...

Well in that case we can probably accept a int32 as that makes the code a lot more readable 😄

@domdom82 domdom82 force-pushed the concurrent-captures-datatype branch from 13b7e2a to c25637c Compare August 7, 2023 12:11
@domdom82 domdom82 force-pushed the concurrent-captures-datatype branch from c25637c to 27cddf8 Compare August 7, 2023 12:14
@domdom82 domdom82 merged commit 2d42515 into cloudfoundry:main Aug 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-ci Triggers PR Validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants