Allow for optimization of config::get

This commit is contained in:
Ben Ogle
2014-10-10 11:04:37 -07:00
parent 95ee29ea39
commit 201345ec5d

View File

@@ -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.
#