diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2019-10-05 20:52:36 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2019-10-11 21:18:36 -0300 |
| commit | caaa8b9c834dcf26292af67ebaaf154cac7cb8fe (patch) | |
| tree | a90d02fef0f02c7740d752a60d8d23921bcf0ad9 | |
| parent | 09ea1a40386f02a13cdb0462cc55af0d03f0c277 (diff) | |
lib: optimize VTY_CHECK_XPATH
There's no need to check for removed configuration objects in the
following two cases:
* A private candidate configuration is being edited;
* The startup configuration is being read.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| -rw-r--r-- | lib/vty.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -254,7 +254,8 @@ static inline void vty_push_context(struct vty *vty, int node, uint64_t id) #define VTY_CHECK_XPATH \ do { \ - if (vty->xpath_index > 0 \ + if (vty->type != VTY_FILE && !vty->private_config \ + && vty->xpath_index > 0 \ && !yang_dnode_exists(vty->candidate_config->dnode, \ VTY_CURR_XPATH)) { \ vty_out(vty, \ |
