mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Allow for optimization of config::get
This commit is contained in:
@@ -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.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user