Don't bother checking the return of node_child as it can never be null
authorCarl Hetherington <cth@carlh.net>
Wed, 4 Aug 2021 18:24:16 +0000 (20:24 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 4 Aug 2021 18:24:16 +0000 (20:24 +0200)
src/cpl.cc

index 92fa70445d46f7de31cb3208780956c0b3c4d213..e52f8b34477980d393dbb5c87448debfeca0e269 100644 (file)
@@ -138,10 +138,8 @@ CPL::CPL (boost::filesystem::path file)
                throw XMLError ("Missing ContentVersion tag in CPL");
        }
        auto rating_list = f.node_child ("RatingList");
-       if (rating_list) {
-               for (auto i: rating_list->node_children("Rating")) {
-                       _ratings.push_back (Rating(i));
-               }
+       for (auto i: rating_list->node_children("Rating")) {
+               _ratings.push_back (Rating(i));
        }
 
        for (auto i: f.node_child("ReelList")->node_children("Reel")) {
@@ -149,14 +147,12 @@ CPL::CPL (boost::filesystem::path file)
        }
 
        auto reel_list = f.node_child ("ReelList");
-       if (reel_list) {
-               auto reels = reel_list->node_children("Reel");
-               if (!reels.empty()) {
-                       auto asset_list = reels.front()->node_child("AssetList");
-                       auto metadata = asset_list->optional_node_child("CompositionMetadataAsset");
-                       if (metadata) {
-                               read_composition_metadata_asset (metadata);
-                       }
+       auto reels = reel_list->node_children("Reel");
+       if (!reels.empty()) {
+               auto asset_list = reels.front()->node_child("AssetList");
+               auto metadata = asset_list->optional_node_child("CompositionMetadataAsset");
+               if (metadata) {
+                       read_composition_metadata_asset (metadata);
                }
        }