-
Notifications
You must be signed in to change notification settings - Fork 40
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
Conversation
dc85924
to
26327c3
Compare
util/bytes.go
Outdated
return true | ||
} | ||
|
||
func innerBytesRoughlyContains( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
26327c3
to
52079c0
Compare
…utput when we cant find prompts
…but do it *after* bytes contains check
No description provided.