diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-11-03 00:51:43 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-11-26 20:35:58 +0100 |
commit | 80243aef050c1f882a169b402ff5c50fed63b451 (patch) | |
tree | 13886bad2557f36b3e19a40fd7b5d105727faecb /lib/yang.c | |
parent | lib: use prefixconstptr instead of const prefixptr (diff) | |
download | frr-80243aef050c1f882a169b402ff5c50fed63b451.tar.xz frr-80243aef050c1f882a169b402ff5c50fed63b451.zip |
lib: don't fetch schema information when creating yang_data structures
Prefetching the schema node when creating yang_data structures is
expensive, and in most cases we don't need that information. In that case,
fetch the schema information only when necessary to improve performance
when fetching operational data.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang.c')
-rw-r--r-- | lib/yang.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/yang.c b/lib/yang.c index a7a50a46b..0e7ea3037 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -522,22 +522,10 @@ void yang_dnode_free(struct lyd_node *dnode) struct yang_data *yang_data_new(const char *xpath, const char *value) { - const struct lys_node *snode; struct yang_data *data; - snode = ly_ctx_get_node(ly_native_ctx, NULL, xpath, 0); - if (!snode) - snode = ly_ctx_get_node(ly_native_ctx, NULL, xpath, 1); - if (!snode) { - flog_err(EC_LIB_YANG_UNKNOWN_DATA_PATH, - "%s: unknown data path: %s", __func__, xpath); - zlog_backtrace(LOG_ERR); - abort(); - } - data = XCALLOC(MTYPE_YANG_DATA, sizeof(*data)); strlcpy(data->xpath, xpath, sizeof(data->xpath)); - data->snode = snode; if (value) data->value = strdup(value); |