Skip to content
Browse files

oops...got my do..whiles confused

  • Loading branch information...
1 parent eef109f commit 931da54a664a514b358951bc5eede85dd800d9cb mnichols committed Aug 2, 2010
Showing with 5 additions and 5 deletions.
  1. +5 −5 Rhino.ServiceBus/Impl/DefaultServiceBus.cs
View
10 Rhino.ServiceBus/Impl/DefaultServiceBus.cs
@@ -350,13 +350,13 @@ private bool PublishInternal(object[] messages)
bool sentMsg = false;
if (messages.Length == 0)
throw new MessagePublicationException("Cannot publish an empty message batch");
-
- var subscriptions = new Uri[0];
+
+ IEnumerable<Uri> subscriptions=new Uri[0];
var index = -1;
- while(subscriptions.Length==0 && index<messages.Length)
+ do
{
- subscriptions = subscriptionStorage.GetSubscriptionsFor(messages[++index].GetType()).ToArray();
- }
+ subscriptions = subscriptionStorage.GetSubscriptionsFor(messages[++index].GetType());
+ } while ((messages.Length > index && subscriptions.Count() == 0));
foreach (Uri subscription in subscriptions)
{

0 comments on commit 931da54

Please sign in to comment.
Something went wrong with that request. Please try again.