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

Use of while loop for condition evaluation #21

Open
gioamato opened this issue Feb 18, 2020 · 2 comments
Open

Use of while loop for condition evaluation #21

gioamato opened this issue Feb 18, 2020 · 2 comments

Comments

@gioamato
Copy link
Contributor

gioamato commented Feb 18, 2020

while c.charAt(0) == ' '
c = c.substring(1, c.length)

Should we use if instead?

@medius
Copy link
Owner

medius commented Feb 19, 2020

Not sure about if statement, but there are other approaches that might be simpler. e.g. https://stackoverflow.com/questions/10730362/get-cookie-by-name

But to be honest, unless something is breaking, it might be better to keep this code as is. Not sure how much advantage there is by changing this part.

@gioamato
Copy link
Contributor Author

No problem. I just wanted to suggest a more efficient and elegant solution than using a loop for an evaluation.

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

No branches or pull requests

2 participants