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

Feat/fuzzy read until input #151

Merged
merged 18 commits into from
Sep 17, 2023
Merged

Feat/fuzzy read until input #151

merged 18 commits into from
Sep 17, 2023

Conversation

carlmontanari
Copy link
Contributor

No description provided.

@carlmontanari carlmontanari force-pushed the feat/fuzzy-read-until-input branch 2 times, most recently from dc85924 to 26327c3 Compare September 6, 2023 03:20
driver/opoptions/channel.go Outdated Show resolved Hide resolved
util/bytes.go Outdated Show resolved Hide resolved
util/bytes.go Show resolved Hide resolved
util/bytes.go Outdated
return true
}

func innerBytesRoughlyContains(
Copy link
Collaborator

Choose a reason for hiding this comment

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

the func name sounds tricky to me. What is inner here? Looks like this is the output byte slice.
But then why is it inner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah not a great name... here is what I was thinking for context:

basically the original implementation (in the link (now a permalink!)) had a labeled break for the "inner" loop -- that is, when it was iterating over the output chars looking for the next char from the input chars. I didnt wanna have the labeled break since I dont really love it so I just used a function instead as you see. so the idea was "inner loop" but yeah its not a great name :)

I guess could do it w/ an anonymous func but that feels not ideal too.

so... as for a name... bytesRoughlyContainsIterOutputForInputChar ? its descriptive! its very long but also not exported so I dont care that much. ill roll w/ this but very open to a better name, so hit me if you got one!

Copy link
Collaborator

Choose a reason for hiding this comment

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

outputBytesContainInputByte?
It seems there is no roughliness here? we basically check if the output byte slice has an input byte and if it is the rest of the output becomes the new output.
At least this is how my brain parses the flow here, I might be off though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ahah touche, défo no roughliness! was keeping the name similar to the "parent" func since I think/hope we wont use that anywhere else. and yeah, your understanding is correct!

@carlmontanari carlmontanari marked this pull request as ready for review September 10, 2023 22:20
@carlmontanari carlmontanari merged commit 67beacb into main Sep 17, 2023
22 checks passed
@carlmontanari carlmontanari deleted the feat/fuzzy-read-until-input branch September 17, 2023 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants