mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Remove unreachable code
This commit is contained in:
@@ -101,23 +101,17 @@ public class VirtualDesktopHelper
|
|||||||
if (virtualDesktopKey is not null)
|
if (virtualDesktopKey is not null)
|
||||||
{
|
{
|
||||||
var allDeskValue = (byte[]?)virtualDesktopKey.GetValue("VirtualDesktopIDs", null) ?? [];
|
var allDeskValue = (byte[]?)virtualDesktopKey.GetValue("VirtualDesktopIDs", null) ?? [];
|
||||||
if (allDeskValue is not null)
|
|
||||||
{
|
|
||||||
// We clear only, if we can read from registry. Otherwise, we keep the existing values.
|
|
||||||
_availableDesktops.Clear();
|
|
||||||
|
|
||||||
// Each guid has a length of 16 elements
|
// We clear only, if we can read from registry. Otherwise, we keep the existing values.
|
||||||
var numberOfDesktops = allDeskValue.Length / 16;
|
_availableDesktops.Clear();
|
||||||
for (var i = 0; i < numberOfDesktops; i++)
|
|
||||||
{
|
// Each guid has a length of 16 elements
|
||||||
var guidArray = new byte[16];
|
var numberOfDesktops = allDeskValue.Length / 16;
|
||||||
Array.ConstrainedCopy(allDeskValue, i * 16, guidArray, 0, 16);
|
for (var i = 0; i < numberOfDesktops; i++)
|
||||||
_availableDesktops.Add(new Guid(guidArray));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ExtensionHost.LogMessage(new LogMessage() { Message = $"VirtualDesktopHelper.UpdateDesktopList() failed to read the list of existing desktops form registry." });
|
var guidArray = new byte[16];
|
||||||
|
Array.ConstrainedCopy(allDeskValue, i * 16, guidArray, 0, 16);
|
||||||
|
_availableDesktops.Add(new Guid(guidArray));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user