diff options
-rw-r--r-- | env.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -24,6 +24,7 @@ fhp_strings[] = { void fhp_env_init(fhp_env_t * const env) { + // calculate hashes for common strings for (size_t i = 0; fhp_strings[i]; i++) env->hashes[i] = fhp_lc_hash_string(fhp_strings[i]); } @@ -34,10 +35,12 @@ fhp_env_t * fhp_get_default_env(void) { static fhp_env_t *r = NULL; + // lazy-init default environment if (!r) { r = &fhp_default_env; fhp_env_init(r); } + // return success return r; } |