Code Duplication    Length = 14-14 lines in 2 locations

system/vendor/swift/Swift.php 2 locations

@@ 385-398 (lines=14) @@
382
    $tmp_sent = 0;
383
    
384
    $it = $list->getIterator("to");
385
    while ($it->hasNext())
386
    {
387
      $it->next();
388
      $address = $it->getValue();
389
      $to[] = $address->build();
390
      try {
391
        $this->command("RCPT TO: " . $address->build(true), 250);
392
        $tmp_sent++;
393
      } catch (Swift_BadResponseException $e) {
394
        $failed++;
395
        $send_event->addFailedRecipient($address->getAddress());
396
        if ($log->hasLevel(Swift_Log::LOG_FAILURES)) $log->addfailedRecipient($address->getAddress());
397
      }
398
    }
399
    $it = $list->getIterator("cc");
400
    while ($it->hasNext())
401
    {
@@ 400-413 (lines=14) @@
397
      }
398
    }
399
    $it = $list->getIterator("cc");
400
    while ($it->hasNext())
401
    {
402
      $it->next();
403
      $address = $it->getValue();
404
      $cc[] = $address->build();
405
      try {
406
        $this->command("RCPT TO: " . $address->build(true), 250);
407
        $tmp_sent++;
408
      } catch (Swift_BadResponseException $e) {
409
        $failed++;
410
        $send_event->addFailedRecipient($address->getAddress());
411
        if ($log->hasLevel(Swift_Log::LOG_FAILURES)) $log->addfailedRecipient($address->getAddress());
412
      }
413
    }
414
    
415
    if ($failed == (count($to) + count($cc)))
416
    {