From 201345ec5d0e2b629c357d5279b7e7672bc68d01 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Fri, 10 Oct 2014 11:04:37 -0700 Subject: [PATCH] Allow for optimization of config::get --- src/config.coffee | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/config.coffee b/src/config.coffee index bda7f2014..0238bb792 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -441,14 +441,11 @@ class Config # file in the type specified by the configuration schema. get: (scopeDescriptor, keyPath) -> if arguments.length == 1 - keyPath = scopeDescriptor - scopeDescriptor = undefined - - if scopeDescriptor? + @getRawValue(scopeDescriptor) + else value = @getRawScopedValue(scopeDescriptor, keyPath) - return value if value? - - @getRawValue(keyPath) + value ?= @getRawValue(keyPath) + value # Essential: Sets the value for a configuration setting. #