Skip to content

[Upstream][Retrieval] Unmerged PR#4 - add longest common prefix function - #6

Merged
jimmybot merged 5 commits into
masterfrom
retrieval-unmerged-pr4-longest-common-prefix
Dec 30, 2024
Merged

jimmybot merged 5 commits into
masterfrom
retrieval-unmerged-pr4-longest-common-prefix

Conversation

@adamark

@adamark adamark commented Dec 28, 2024

Copy link
Copy Markdown
Collaborator

Original PR link
PR Description:

returns matching bianries like 'prefix/2', along with longest common prefix of matching binaries. Very common when implementing auto-completion.

I changed the function name from the authors prefix! to longest_common_prefix as we should follow elixir best practices which would argue that bang! appended functions should be used to indicate that the function is unsafe and may raise and also should only be used when there is a "safer" function with the same name that won't raise (at least not intentionally). This best practice is also shared with ruby which is why I was compelled to change it.

@adamark adamark added the enhancement New feature or request label Dec 28, 2024
@jimmybot

Copy link
Copy Markdown

@adamark this one is also good and makes sense on function name. Would also add that this could use docs as a quick follow up if you're up for that. Merging

@jimmybot
jimmybot merged commit c2ec656 into master Dec 30, 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.

2 participants