Skip to content

Commit a749886

Browse files
committed
Remove some unnecessary whitespace checks within ShellLinkFile class.
1 parent 0a598bb commit a749886

20 files changed

Lines changed: 4 additions & 4 deletions

src/PSADT/PSADT/ShortcutManagement/ShellLinkFile.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,20 @@ public string? TargetPath
192192
ObjectDisposedException.ThrowIf(_disposed, this);
193193
Span<char> buffer = stackalloc char[(int)PInvoke.MAX_PATH];
194194
buffer.Clear(); _shellLink.GetPath(buffer, 0);
195-
if (buffer.ToStringUni() is string targetPath && !string.IsNullOrWhiteSpace(targetPath))
195+
if (buffer.ToStringUni() is string targetPath)
196196
{
197197
return targetPath;
198198
}
199-
if (GetStringProperty(in PInvoke.PKEY_Link_TargetUrlPath) is string targetUrlPath && !string.IsNullOrWhiteSpace(targetUrlPath))
199+
if (GetStringProperty(in PInvoke.PKEY_Link_TargetUrlPath) is string targetUrlPath)
200200
{
201201
return targetUrlPath;
202202
}
203-
if (GetStringProperty(in PInvoke.PKEY_Link_TargetParsingPath) is string parsingPath && !string.IsNullOrWhiteSpace(parsingPath))
203+
if (GetStringProperty(in PInvoke.PKEY_Link_TargetParsingPath) is string parsingPath)
204204
{
205205
return parsingPath;
206206
}
207207
buffer.Clear(); _shellLink.GetPath(buffer, (uint)SLGP_FLAGS.SLGP_RAWPATH);
208-
return buffer.ToStringUni() is string rawTargetPath && !string.IsNullOrWhiteSpace(rawTargetPath)
208+
return buffer.ToStringUni() is string rawTargetPath
209209
? rawTargetPath
210210
: null;
211211
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)