jonhadfield / python-hosts

a hosts file manager library written in python
MIT License
125 stars 33 forks source link

don't repeate yourself #42

Closed TheTesla closed 2 years ago

TheTesla commented 3 years ago

https://github.com/jonhadfield/python-hosts/blob/f85397383e74512ba25ddaa496559e96ad993d75/python_hosts/hosts.py#L253 https://github.com/jonhadfield/python-hosts/blob/f85397383e74512ba25ddaa496559e96ad993d75/python_hosts/hosts.py#L272

Here you implement the find algorithm twice. It is better to call find_all_matching() by remove_all_matching(). When you later improve your find_all_matching() function, remove_all_matching() is keped consistent.

github-actions[bot] commented 2 years ago

Stale issue message