summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-28 03:56:28 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-28 03:56:28 -0400
commitb63fcd650a42b6035c35de951e1e8476234dd2e5 (patch)
tree93e9875c2bbea16c9fc69ed7a452cf71f3ae0ef9
parent5d8106b969b9f6c2d530eb3c32c0065c5f5b0e35 (diff)
downloadlibfhp-b63fcd650a42b6035c35de951e1e8476234dd2e5.tar.bz2
libfhp-b63fcd650a42b6035c35de951e1e8476234dd2e5.zip
add comments
-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;
}