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

Optimisations #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Optimisations #168

wants to merge 1 commit into from

Conversation

Epithermal
Copy link

I removed the if statement for the case where selectionStart > minuteMarker and !hideSeconds, and moved the assignment of cursorSelection to 'seconds' to the else block. This is because the if statement is not needed - if hideSeconds is true, the function will not enter the else block. If hideSeconds is false, the function will enter the else block and cursorSelection will be assigned to 'seconds'.

I destructured the event parameter to avoid having to use event.target multiple times. This reduces the amount of code and may also improve readability.

I removed the if statement for the case where selectionStart > minuteMarker and !hideSeconds, and moved the assignment of cursorSelection to 'seconds' to the else block. This is because the if statement is not needed - if hideSeconds is true, the function will not enter the else block. If hideSeconds is false, the function will enter the else block and cursorSelection will be assigned to 'seconds'.

I destructured the event parameter to avoid having to use event.target multiple times. This reduces the amount of code and may also improve readability.
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.

1 participant