Cleanup: use some better variable names and tidy ifs.
authorCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 13:26:05 +0000 (15:26 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 22:42:59 +0000 (00:42 +0200)
src/wx/dcp_panel.cc

index 4da8abe36ed1bdd3c33665ad06319c3a71c54be1..7fc6f00df0ccdb97ac5471580e28ef79ab3aeb7e 100644 (file)
@@ -588,11 +588,10 @@ DCPPanel::container_changed ()
                return;
        }
 
-       auto const n = _container->get();
-       if (n) {
+       if (auto const container = _container->get()) {
                auto ratios = Ratio::containers ();
-               DCPOMATIC_ASSERT(*n < int(ratios.size()));
-               _film->set_container(ratios[*n]);
+               DCPOMATIC_ASSERT(*container < int(ratios.size()));
+               _film->set_container(ratios[*container]);
        }
 }
 
@@ -605,9 +604,8 @@ DCPPanel::dcp_content_type_changed ()
                return;
        }
 
-       auto n = _dcp_content_type->get();
-       if (n) {
-               _film->set_dcp_content_type(DCPContentType::from_index(*n));
+       if (auto const type = _dcp_content_type->get()) {
+               _film->set_dcp_content_type(DCPContentType::from_index(*type));
        }
 }