From: Shawdooow Date: Sun, 21 Nov 2021 09:36:55 +0000 (-0500) Subject: remove else X-Git-Tag: v0.2.4-beta~13^2~2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=9d71f01f095afbc0089c26e1a85fd1c5e467200f;p=jp%2Fvke.net.git remove else --- diff --git a/vke/src/Utils.cs b/vke/src/Utils.cs index 0a1ef6c..fc16876 100644 --- a/vke/src/Utils.cs +++ b/vke/src/Utils.cs @@ -44,19 +44,14 @@ namespace Vulkan { public static Stream GetStreamFromPath (string path) { if (path.Contains(":", StringComparison.Ordinal)) { Stream stream = null; - string resId = path.Substring (1); - string[] assemblyNames = resId.Split (':'); + string[] assemblyNames = path.Split (':'); Assembly assembly = AppDomain.CurrentDomain.GetAssemblies ().FirstOrDefault (aa => aa.GetName ().Name == assemblyNames[0]); if (assembly == null) throw new Exception("Assembly not found: " + path); - else - { - if (tryFindResource(assembly, resId.Replace(':', '.'), out stream)) - return stream; - new Exception("Embedded resource not found in assembly: " + path); - } - - throw new Exception ("Resource not found: " + path); + + if (tryFindResource(assembly, path.Replace(':', '.'), out stream)) + return stream; + throw new Exception("Embedded resource not found in assembly: " + path); } if (!File.Exists (path)) throw new FileNotFoundException ("File not found: ", path);