TunnelsManager: get rid of index management
No need for premature optimization. There aren't that many tunnels most of the time, and calling sort on a partially sorted array is fast. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -312,11 +312,11 @@ extension TunnelsListTableViewController: TunnelsManagerDelegate {
|
||||
func tunnelModified(at index: Int) {
|
||||
tableView.reloadRows(at: [IndexPath(row: index, section: 0)], with: .automatic)
|
||||
}
|
||||
|
||||
func tunnelsChanged() {
|
||||
tableView.reloadData()
|
||||
|
||||
func tunnelMoved(at oldIndex: Int, to newIndex: Int) {
|
||||
tableView.moveRow(at: IndexPath(row: oldIndex, section: 0), to: IndexPath(row: newIndex, section: 0))
|
||||
}
|
||||
|
||||
|
||||
func tunnelRemoved(at index: Int) {
|
||||
tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .automatic)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user