[GH-ISSUE #13] Q: Why is the position of a host on the line used? #4

Closed
opened 2026-03-02 05:08:03 +03:00 by kerem · 2 comments
Owner

Originally created by @tomjn on GitHub (Oct 16, 2020).
Original GitHub issue: https://github.com/goodhosts/hostsfile/issues/13

I'm debugging an issue that's sourced to code introduced in this commit:

github.com/goodhosts/hostsfile@57158c4acf

However, looking at it, I see that a host is being removed based on its position in a list, which does not make sense to me.

Would it not make more sense to generate the list fresh or remove by value? This seems very fragile. Would it not make more sense to de-duplicate any entries then remove by value?

Originally created by @tomjn on GitHub (Oct 16, 2020). Original GitHub issue: https://github.com/goodhosts/hostsfile/issues/13 I'm debugging an issue that's sourced to code introduced in this commit: https://github.com/goodhosts/hostsfile/commit/57158c4acf4812de4e18728a918eac8fcfe6f628 However, looking at it, I see that a host is being removed based on its position in a list, which does not make sense to me. Would it not make more sense to generate the list fresh or remove by value? This seems very fragile. Would it not make more sense to de-duplicate any entries then remove by value?
kerem closed this issue 2026-03-02 05:08:03 +03:00
Author
Owner

@luthermonson commented on GitHub (Oct 16, 2020):

are you talking about line 285? frankly i dont think that's needed any more as 289 stomps out Lines any way, i think that was from the first writing of that function and i left it in be accident. What is the issue youre seeing? Maybe I can step through the data you have and confirm

<!-- gh-comment-id:710314518 --> @luthermonson commented on GitHub (Oct 16, 2020): are you talking about line 285? frankly i dont think that's needed any more as 289 stomps out Lines any way, i think that was from the first writing of that function and i left it in be accident. What is the issue youre seeing? Maybe I can step through the data you have and confirm
Author
Owner

@tomjn commented on GitHub (Oct 16, 2020):

Another issue got raised for it at https://github.com/goodhosts/cli/issues/16

<!-- gh-comment-id:710374489 --> @tomjn commented on GitHub (Oct 16, 2020): Another issue got raised for it at https://github.com/goodhosts/cli/issues/16
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hostsfile#4
No description provided.