Code Duplication    Length = 10-10 lines in 2 locations

calendar/inc/class.calendar_boupdate.inc.php 2 locations

@@ 324-333 (lines=10) @@
321
			}
322
			// check if we are withing the allowed quantity and if not add all events using that resource
323
			// seems this function is doing very strange things, it gives empty conflicts
324
			foreach($max_quantity as $uid => $max)
325
			{
326
				if ($quantity[$uid] > $max)
327
				{
328
					foreach((array)$possible_quantity_conflicts[$uid] as $conflict)
329
					{
330
						$conflicts[$conflict['id'].'-'.$this->date2ts($conflict['start'])] =& $possible_quantity_conflicts[$k];
331
					}
332
				}
333
			}
334
			unset($possible_quantity_conflicts);
335
336
			if (count($conflicts))
@@ 546-555 (lines=10) @@
543
		//error_log(__METHOD__."() conflict check took ".number_format(microtime(true)-$start, 3).'s');
544
		// check if we are withing the allowed quantity and if not add all events using that resource
545
		// seems this function is doing very strange things, it gives empty conflicts
546
		foreach($max_quantity as $uid => $max)
547
		{
548
			if ($quantity[$uid] > $max)
549
			{
550
				foreach((array)$possible_quantity_conflicts[$uid] as $conflict)
551
				{
552
					$conflicts[$conflict['id'].'-'.$this->date2ts($conflict['start'])] =& $possible_quantity_conflicts[$k];
553
				}
554
			}
555
		}
556
		unset($possible_quantity_conflicts);
557
558
		if (count($conflicts))