Skip to content

Commit

Permalink
Make return expression more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Mar 22, 2023
1 parent 64ad452 commit f9a0d7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/EmbeddedResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ public static Stream GetStream(string relativePath)
if (string.IsNullOrEmpty(manifestResourceName))
throw new InvalidOperationException($"Did not find required resource ending in '{resourceName}' in assembly '{baseName}'.");

var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream(manifestResourceName);

if (stream == null)
return
Assembly.GetExecutingAssembly().GetManifestResourceStream(manifestResourceName) ??
throw new InvalidOperationException($"Did not find required resource '{manifestResourceName}' in assembly '{baseName}'.");

return stream;
}
}
3 changes: 1 addition & 2 deletions src/ThisAssembly.Constants/ConstantsGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
Expand Down

0 comments on commit f9a0d7e

Please sign in to comment.