better comptime

This commit is contained in:
2022-07-06 13:29:36 +03:00
parent efdc919195
commit 9bd922a55a
2 changed files with 8 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ const State = struct {
// global_state is initialized on first call to an nss function
var global_state: State = undefined;
var global_start = once(init);
var global_init = once(init);
// assigns State from environment variables et al
fn init() void {
@@ -80,7 +80,7 @@ export fn _nss_turbo_getpwuid_r(
len: usize,
errnop: *c_int,
) c.enum_nss_status {
global_start.call();
global_init.call();
if (global_state.file == null) {
errnop.* = @enumToInt(os.E.AGAIN);