Code Duplication    Length = 10-12 lines in 2 locations

engine/lib/river.php 2 locations

@@ 465-474 (lines=10) @@
462
			$guids[$item->target_guid] = true;
463
		}
464
	}
465
	if ($guids) {
466
		// The entity cache only holds 256. We don't want to bump out any plugins.
467
		$guids = array_slice($guids, 0, 200, true);
468
		// return value unneeded, just priming cache
469
		elgg_get_entities(array(
470
			'guids' => array_keys($guids),
471
			'limit' => 0,
472
			'distinct' => false,
473
		));
474
	}
475
476
	// prefetch object containers, in case they were not in the targets
477
	$guids = array();
@@ 484-495 (lines=12) @@
481
			$guids[$object->container_guid] = true;
482
		}
483
	}
484
	if ($guids) {
485
		$guids = array_slice($guids, 0, 200, true);
486
		elgg_get_entities(array(
487
			'guids' => array_keys($guids),
488
			'limit' => 0,
489
			'distinct' => false,
490
491
			// Why specify? user containers are likely already loaded via the owners, and
492
			// specifying groups allows ege() to auto-join the groups_entity table
493
			'type' => 'group',
494
		));
495
	}
496
497
	// Note: We've tried combining the above ege() calls into one (pulling containers at the same time).
498
	// Although it seems like it would reduce queries, it added some. o_O