Browse Source

replace try-catch-all with Guid.TryParse

pull/550/head
Siegfried Pammer 11 years ago
parent
commit
8ea39b77e6
  1. 11
      ILSpy/CommandLineArguments.cs

11
ILSpy/CommandLineArguments.cs

@ -53,15 +53,12 @@ namespace ICSharpCode.ILSpy
this.NoActivate = true; this.NoActivate = true;
else if (arg.StartsWith("/fixedGuid:", StringComparison.OrdinalIgnoreCase)) { else if (arg.StartsWith("/fixedGuid:", StringComparison.OrdinalIgnoreCase)) {
string guid = arg.Substring("/fixedGuid:".Length); string guid = arg.Substring("/fixedGuid:".Length);
try {
if (guid.Length < 32) if (guid.Length < 32)
guid = guid + new string('0', 32 - guid.Length); guid = guid + new string('0', 32 - guid.Length);
this.FixedGuid = new Guid(guid); Guid fixedGuid;
} catch { if (Guid.TryParse(guid, out fixedGuid))
this.FixedGuid = null; this.FixedGuid = fixedGuid;
} } else if (arg.StartsWith("/saveDir:", StringComparison.OrdinalIgnoreCase))
}
else if (arg.StartsWith("/saveDir:", StringComparison.OrdinalIgnoreCase))
this.SaveDirectory = arg.Substring("/saveDir:".Length); this.SaveDirectory = arg.Substring("/saveDir:".Length);
} else { } else {
this.AssembliesToLoad.Add(arg); this.AssembliesToLoad.Add(arg);

Loading…
Cancel
Save