Skip to content

Commit

Permalink
[base] Removed untested micro-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Jan 17, 2017
1 parent f91b7b5 commit 4a63d7f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions netjsonconfig/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from ..exceptions import ValidationError
from ..schema import DEFAULT_FILE_MODE
from ..utils import evaluate_vars, merge_config, var_pattern
from ..utils import evaluate_vars, merge_config


class BaseBackend(object):
Expand Down Expand Up @@ -69,10 +69,6 @@ def _evaluate_vars(self, config, context):
# return immediately if context is empty
if not context:
return config
# return immediately if no variables are found
netjson = self.json(validate=False)
if var_pattern.search(netjson) is None:
return config
# only if variables are found perform evaluation
return evaluate_vars(config, context)

Expand Down

0 comments on commit 4a63d7f

Please sign in to comment.