-
Notifications
You must be signed in to change notification settings - Fork 80
Defer hiding the attached session until after duplicates have been hidden #250
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
Defer hiding the attached session until after duplicates have been hidden #250
Conversation
| for i, index := range fullOrderedIndex { | ||
| if fullDirectory[index].Name == attachedSession.Name { | ||
| fullOrderedIndex = slices.Delete(fullOrderedIndex, i, i+1) | ||
| break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Does it seem right to break here? Is it possible to have two sessions with the same
.Name? - If it's not possible to have two sessions with the same
.Name, isn't the active session always first in the list? So Couldn't I skip the iteration and just checkfullDirectory[fullOrderedIndex[0]].NameagainstattachedSession.Nameto save a bunch of CPU cycles?
joshmedeski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some related code got merged recently, can you confirm that main still has the same issue?
|
@markjaquith flagging this again. A bit has been merged, can you confirm the issue is still present? |
|
Hey @markjaquith are you still seeing this issue? |
|
I created I still think that if I'm hiding the attached and also hiding duplicates, that every duplicate of the attached session directory should be hidden. What I'm trying to accomplish is:
|
|
Thanks for the feedback, does this PR confirm it fixes it? |
|
I manually tested this and it appears to be working as expected, thanks! |
fixes #249
Warning
Be gentle: this is the first Go code I've written
Note
Using
slices.Deletewas recommended by the linter as the modern way, versus slicing around the range you want to delete, so I went with that.