yanglint OPTIMIZE setting LY_CTX_SET_PRIV_PARSED
Flag causes recompilation, so some models are unnecessarily
compiled twice. The flag should be set as soon as possible.
@@ -657,6 +657,11 @@ fill_context(int argc, char *argv[], struct context *c)
}
}
+ if (c->schema_out_format == LYS_OUT_TREE) {
+ /* print tree from lysc_nodes */
+ ly_ctx_set_options(c->ctx, LY_CTX_SET_PRIV_PARSED);
+ }
+
/* process input files provided as standalone command line arguments,
* schema modules are parsed and inserted into the context,
* data files are just checked and prepared into internal structures for further processing */
@@ -665,11 +670,6 @@ fill_context(int argc, char *argv[], struct context *c)
return ret;
}
- if (c->schema_out_format == LYS_OUT_TREE) {
- /* print tree from lysc_nodes */
- ly_ctx_set_options(c->ctx, LY_CTX_SET_PRIV_PARSED);
- }
-
/* the second batch of checks */
if (c->schema_print_options && !c->schema_out_format) {
YLMSG_W("Schema printer options specified, but the schema output format is missing.\n");
