Minor code improvements:
[shipsimu.git] / application / ship-simu / main / companies / class_ShippingCompany.php
index 1eef86b61c9afa4b5a8b120409ebc982b8f40707..7549af4056c7d5ac0e58a13385f8d89b3d974848 100644 (file)
@@ -331,14 +331,14 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                                $iterator->seek($pos);
 
                                // Is the current position valid?
-                               if ($iterator->valid()) {
-                                       // Element holen
-                                       $employee = $iterator->current();
-                               } else {
+                               if (!$iterator->valid()) {
                                        // Should normally not happen... :(
                                        throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
-                               }
-                       }
+                               } // END - if
+
+                               // Get current element
+                               $employee = $iterator->current();
+                       } // END - while
 
                        // A dummy just for the description and real class
                        $dummy = CompanyEmployee::createCompanyEmployee("", "", "M", 1970, 1, 1, $employee->isMarried(), 0);