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

Feature: Twingly::URL#normalized? #68

Open
jage opened this issue Dec 2, 2015 · 0 comments
Open

Feature: Twingly::URL#normalized? #68

jage opened this issue Dec 2, 2015 · 0 comments
Labels

Comments

@jage
Copy link
Contributor

jage commented Dec 2, 2015

I would like to be able to ask the object if it's normalized: Twingly::URL#normalized?

A basic implementation could be self.to_s == self.normalized.to_s.

An optimization could be to set a boolean when #normalized is called. This boolean could then be checked in #normalized to return self instead of a new normalized instance. It would improve the performance when #normalized and #normalized? are called multiple times.

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

No branches or pull requests

1 participant