data tree MAINTENANCE simplify key check
diff --git a/src/tree_data.c b/src/tree_data.c
index e59088c..65a56fc 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1875,7 +1875,7 @@
             if (!(node1->schema->flags & LYS_KEYLESS) && !(options & LYD_COMPARE_FULL_RECURSION)) {
                 /* lists with keys, their equivalence is based on their keys */
                 for (struct lysc_node *key = ((struct lysc_node_list*)node1->schema)->child;
-                        key && key->nodetype == LYS_LEAF && (key->flags & LYS_KEY);
+                        key && (key->flags & LYS_KEY);
                         key = key->next) {
                     if (lyd_compare(iter1, iter2, options)) {
                         return LY_ENOT;
@@ -2051,7 +2051,7 @@
             /* always duplicate keys of a list */
             child = orig->child;
             for (struct lysc_node *key = ((struct lysc_node_list *)dup->schema)->child;
-                    key && key->nodetype == LYS_LEAF && (key->flags & LYS_KEY);
+                    key && (key->flags & LYS_KEY);
                     key = key->next) {
                 if (!child) {
                     /* possibly not keys are present in filtered tree */