From 0dafdb4cde84a426340120d8f6244e5df2b83fa2 Mon Sep 17 00:00:00 2001 From: StunxFS <56417208+StunxFS@users.noreply.github.com> Date: Tue, 2 Mar 2021 15:38:32 -0400 Subject: [PATCH] dl: minor improvement of get_shared_library_extension (#9070) --- vlib/dl/dl.v | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/vlib/dl/dl.v b/vlib/dl/dl.v index 97ec50e1c4..9d9fd1ab8e 100644 --- a/vlib/dl/dl.v +++ b/vlib/dl/dl.v @@ -9,14 +9,13 @@ pub const ( // i.e. .dll on windows, .so on most unixes, .dylib on macos. [inline] pub fn get_shared_library_extension() string { - mut res := '.so' - $if macos { - res = '.dylib' + return $if windows { + '.dll' + } $else $if macos { + '.dylib' + } $else { + '.so' } - $if windows { - res = '.dll' - } - return res } // get_libname returns a library name with the operating system specific extension for