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: add new built-in condition for line ending #597

Merged
merged 2 commits into from
Sep 14, 2022

Conversation

weilbith
Copy link
Contributor

Closes #592

@L3MON4D3
Copy link
Owner

Hey, nice 👍
TY!

@L3MON4D3 L3MON4D3 merged commit 14b801f into L3MON4D3:master Sep 14, 2022
@atticus-sullivan
Copy link
Contributor

Working on #612, I've looked at this code again. Is there any reason why you're just comparing the amount of characters in the string? (comparing strings in lua should be as cheap as a pointer comparison afaik)

@L3MON4D3
Copy link
Owner

L3MON4D3 commented Oct 2, 2022

Mhmm, well number of characters works because both strings are the same line, so same lengths <=> same string.
I hadn't considered that just comparing them directly could be faster, but reading up on interning, that does seem to be the case (very interesting, I would've thought looking up the result after every string-operation leads to overall worse performance, but it seems to be more nuanced that that).
I'm definitely open to making this a direct comparison, best with a comment so it's clear that this might be/is faster than comparing lengths.

@atticus-sullivan
Copy link
Contributor

Alright, then I guess I'll do this change in #612 (or new PR?)

@L3MON4D3
Copy link
Owner

L3MON4D3 commented Oct 2, 2022

Amend it, different commit, same PR is alright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regular expressions with end-of-line match
3 participants