Skip to content

Commit

Permalink
#88 - Remove unused/risky range early exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhedstrom committed May 25, 2017
1 parent fc938e3 commit df13f62
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
9 changes: 0 additions & 9 deletions message_subscribe.module
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,9 @@ function message_subscribe_message_subscribe_get_subscribers(MessageInterface $m
$result = $query->execute();

foreach ($result as $row) {

$uids[$row->uid] = !empty($uids[$row->uid]) ? $uids[$row->uid] : new DeliveryCandidate([], [], $row->uid);
// Register the flag name.
$uids[$row->uid]->addFlag($row->flag_id);

if ($range) {
--$range;
if ($range == 0) {
// We've reach the requested item.
return $uids;
}
}
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/Subscribers.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ public function sendMessage(EntityInterface $entity, MessageInterface $message,
$message->save();
}

if ($use_queue) {
$id = $entity->id();
}

if ($use_queue && empty($subscribe_options['queue'])) {
if (empty($message->id())) {
throw new MessageSubscribeException('Cannot add a non-saved message to the queue.');
Expand Down

0 comments on commit df13f62

Please sign in to comment.