From d82e5a590aba5f93c2b9e850baa6fc027a4733b0 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 26 May 2007 04:04:20 +0000 Subject: [PATCH] move exit statement inside conditional to speed up loop execution --- lib/WebGUI/Inbox.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WebGUI/Inbox.pm b/lib/WebGUI/Inbox.pm index 08c4c1a43..7ddfa1561 100644 --- a/lib/WebGUI/Inbox.pm +++ b/lib/WebGUI/Inbox.pm @@ -111,8 +111,8 @@ sub getMessagesForUser { if ($user->userId eq $userId || $user->isInGroup($groupId)) { push(@messages, $self->getMessage($messageId)); $counter++; + last if ($counter >= $limit); } - last if ($counter >= $limit); } $rs->finish; return \@messages;