aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/TunnelViewModel.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/UI/TunnelViewModel.swift')
-rw-r--r--WireGuard/WireGuard/UI/TunnelViewModel.swift22
1 files changed, 11 insertions, 11 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift
index 92a1a64..e623eab 100644
--- a/WireGuard/WireGuard/UI/TunnelViewModel.swift
+++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift
@@ -379,8 +379,8 @@ class TunnelViewModel {
var peersData: [PeerData] = []
if let tunnelConfiguration = tunnelConfiguration {
interfaceData.validatedConfiguration = tunnelConfiguration.interface
- for (i, peerConfiguration) in tunnelConfiguration.peers.enumerated() {
- let peerData = PeerData(index: i)
+ for (index, peerConfiguration) in tunnelConfiguration.peers.enumerated() {
+ let peerData = PeerData(index: index)
peerData.validatedConfiguration = peerConfiguration
peersData.append(peerData)
}
@@ -397,22 +397,22 @@ class TunnelViewModel {
func appendEmptyPeer() {
let peer = PeerData(index: peersData.count)
peersData.append(peer)
- for p in peersData {
- p.numberOfPeers = peersData.count
- p.updateExcludePrivateIPsFieldState()
+ for peer in peersData {
+ peer.numberOfPeers = peersData.count
+ peer.updateExcludePrivateIPsFieldState()
}
}
func deletePeer(peer: PeerData) {
let removedPeer = peersData.remove(at: peer.index)
assert(removedPeer.index == peer.index)
- for p in peersData[peer.index ..< peersData.count] {
- assert(p.index > 0)
- p.index = p.index - 1
+ for peer in peersData[peer.index ..< peersData.count] {
+ assert(peer.index > 0)
+ peer.index -= 1
}
- for p in peersData {
- p.numberOfPeers = peersData.count
- p.updateExcludePrivateIPsFieldState()
+ for peer in peersData {
+ peer.numberOfPeers = peersData.count
+ peer.updateExcludePrivateIPsFieldState()
}
}