From f6eeb49bd10b43309b649b092dec18cf2a168130 Mon Sep 17 00:00:00 2001
From: Brian Pepple <bdpepple@gmail.com>
Date: Sun, 27 Sep 2020 11:48:21 -0400
Subject: [PATCH] Hoist repeated code outside conditional statement

---
 jellyfin_kodi/objects/obj.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/jellyfin_kodi/objects/obj.py b/jellyfin_kodi/objects/obj.py
index b506a969..5aedb80f 100644
--- a/jellyfin_kodi/objects/obj.py
+++ b/jellyfin_kodi/objects/obj.py
@@ -125,11 +125,10 @@ class Objects(object):
         obj = self.__recursive__(obj, first)
 
         if obj:
-            if rest:
-                for item in obj:
+            for item in obj:
+                if rest:
                     self.__recursiveloop__(item, rest)
-            else:
-                for item in obj:
+                else:
                     yield item
 
     def __recursive__(self, obj, keys):