Skip to content

Commit 6c96066

Browse files
committed
Optimize IpAddresses assignment logic
- Changed the assignment of `IpAddresses` to use the pre-fetched `candidateIpAddresses` list instead of calling `NetworkHelper.GetAllLocalIPv4()` twice. - Improved code efficiency by avoiding redundant method calls.
1 parent 0a23bea commit 6c96066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TouchSenderTablet.GUI/ViewModels/MainViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public MainViewModel(ITouchReceiverSettingsService touchReceiverSettingsService,
113113
_screenOptions = _touchReceiverSettingsService.ScreenOptions;
114114

115115
var candidateIpAddresses = NetworkHelper.GetAllLocalIPv4().ToList();
116-
IpAddresses = candidateIpAddresses.Count > 0 ? string.Join(" / ", NetworkHelper.GetAllLocalIPv4()) : "Unknown".GetLocalized();
116+
IpAddresses = candidateIpAddresses.Count > 0 ? string.Join(" / ", candidateIpAddresses) : "Unknown".GetLocalized();
117117
}
118118

119119
private void SetInitialCanvas()

0 commit comments

Comments
 (0)