summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--env.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/env.c b/env.c
index 8994598..6b94f0c 100644
--- a/env.c
+++ b/env.c
@@ -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;
}