Skip to content

Commit f9a0d7e

Browse files
committed
Make return expression more compact
1 parent 64ad452 commit f9a0d7e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/EmbeddedResource.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ public static Stream GetStream(string relativePath)
4040
if (string.IsNullOrEmpty(manifestResourceName))
4141
throw new InvalidOperationException($"Did not find required resource ending in '{resourceName}' in assembly '{baseName}'.");
4242

43-
var stream = Assembly.GetExecutingAssembly()
44-
.GetManifestResourceStream(manifestResourceName);
45-
46-
if (stream == null)
43+
return
44+
Assembly.GetExecutingAssembly().GetManifestResourceStream(manifestResourceName) ??
4745
throw new InvalidOperationException($"Did not find required resource '{manifestResourceName}' in assembly '{baseName}'.");
48-
49-
return stream;
5046
}
5147
}

src/ThisAssembly.Constants/ConstantsGenerator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.IO;
43
using System.Linq;
54
using System.Text;

0 commit comments

Comments
 (0)