[rygel] media-export: Minor refactor



commit e340c6779165adffa8aff9414fb198cab72bf307
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Mar 28 22:01:15 2010 +0300

    media-export: Minor refactor

 .../rygel-media-export-root-container.vala         |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index bc218a8..c5bf86c 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -386,12 +386,11 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
                 var id = Checksum.compute_for_string (ChecksumType.MD5,
                                                       parent.get_uri ());
                 try {
-                    var parent_container = this.media_db.get_object (id);
-                    if (parent_container != null) {
-                        this.harvest (file, (MediaContainer)parent_container);
-                    } else {
-                        assert_not_reached ();
-                    }
+                    var parent_container = this.media_db.get_object (id)
+                                           as MediaContainer;
+                    assert (parent_container != null);
+
+                    this.harvest (file, parent_container);
                 } catch (Rygel.DatabaseError error) {
                     warning ("Error while getting parent container for " +
                              "filesystem event: %s",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]