From 45e21bc311c7c09bcf616bd79a4c9660d47b5f04 Mon Sep 17 00:00:00 2001 From: jrfondren <41455523+jrfondren@users.noreply.github.com> Date: Sun, 4 Sep 2022 05:22:38 -0500 Subject: [PATCH] os: remove private unix_environ() helper function, it is not needed anymore (#15654) --- vlib/os/environment.c.v | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vlib/os/environment.c.v b/vlib/os/environment.c.v index 71d676d1c..f4889b33d 100644 --- a/vlib/os/environment.c.v +++ b/vlib/os/environment.c.v @@ -79,11 +79,6 @@ pub fn unsetenv(name string) int { // See: https://docs.microsoft.com/bg-bg/windows/win32/api/processenv/nf-processenv-getenvironmentstrings // os.environ returns a map of all the current environment variables -fn unix_environ() &&char { - // TODO: remove this helper function, when `&&char(C.environ)` works properly - return voidptr(C.environ) -} - pub fn environ() map[string]string { mut res := map[string]string{} $if windows { @@ -101,7 +96,7 @@ pub fn environ() map[string]string { } C.FreeEnvironmentStringsW(estrings) } $else { - start := unix_environ() + start := &&char(C.environ) mut i := 0 for { x := unsafe { start[i] } -- 2.30.2