]> O.S.I.I.S - jp/vke.net.git/commitdiff
remove else
authorShawdooow <banhammer1915@gmail.com>
Sun, 21 Nov 2021 09:36:55 +0000 (04:36 -0500)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 21 Nov 2021 11:59:27 +0000 (12:59 +0100)
vke/src/Utils.cs

index 0a1ef6c14a5a0e860f8035af048970ff3877d4d2..fc16876aaf5aac930b7e29f75b0dea7c6156d2bb 100644 (file)
@@ -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);