tree schema BUGFIX separate single-item dep set creation
diff --git a/src/context.c b/src/context.c
index 922bb96..69c3b77 100644
--- a/src/context.c
+++ b/src/context.c
@@ -208,8 +208,8 @@
         /* create dep set for the module and mark all the modules that will be (re)compiled */
         LY_CHECK_GOTO(ret = lys_unres_dep_sets_create(ctx, &unres.dep_sets, mod), cleanup);
 
-        /* (re)compile the whole dep set */
-        LY_CHECK_GOTO(ret = lys_compile_dep_set_r(ctx, unres.dep_sets.objs[0], &unres), cleanup);
+        /* (re)compile the whole dep set (other dep sets will have no modules marked for compilation) */
+        LY_CHECK_GOTO(ret = lys_compile_depset_all(ctx, &unres), cleanup);
     }
 
 cleanup:
@@ -505,7 +505,6 @@
 ly_ctx_compile(struct ly_ctx *ctx)
 {
     LY_ERR ret = LY_SUCCESS;
-    uint32_t i;
     struct lys_glob_unres unres = {0};
 
     LY_CHECK_ARG_RET(NULL, ctx, LY_EINVAL);
@@ -514,9 +513,7 @@
     LY_CHECK_GOTO(ret = lys_unres_dep_sets_create(ctx, &unres.dep_sets, NULL), cleanup);
 
     /* (re)compile all the dep sets */
-    for (i = 0; i < unres.dep_sets.count; ++i) {
-        LY_CHECK_GOTO(ret = lys_compile_dep_set_r(ctx, unres.dep_sets.objs[i], &unres), cleanup);
-    }
+    LY_CHECK_GOTO(ret = lys_compile_depset_all(ctx, &unres), cleanup);
 
 cleanup:
     if (ret) {