From 1b4f73c6e3e9a354ff44b23263490477e07d381e Mon Sep 17 00:00:00 2001
From: Jericho <desautelsj@hotmail.com>
Date: Thu, 28 Jan 2021 15:57:00 -0500
Subject: [PATCH] (GH-368) Improve xml comments

---
 Source/StrongGrid/Extensions/Public.cs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Source/StrongGrid/Extensions/Public.cs b/Source/StrongGrid/Extensions/Public.cs
index 74fcfcef..b2035bcd 100644
--- a/Source/StrongGrid/Extensions/Public.cs
+++ b/Source/StrongGrid/Extensions/Public.cs
@@ -1157,12 +1157,19 @@ public static async Task<IpAddress[]> GetUnassignedAsync(this IIpAddresses ipAdd
 
 			while (true)
 			{
+				// Retrieve 500 ip addresses at a time (that's the maximum SendGrid allow us to retrieve at a time)
 				var allIpAddresses = await ipAddresses.GetAllAsync(limit: Utils.MaxSendGridPagingLimit, offset: currentOffset, cancellationToken: cancellationToken).ConfigureAwait(false);
+
+				// Take the addresses that have not been added to a pool
 				unassignedIpAddresses.AddRange(allIpAddresses.Records.Where(ip => ip.Pools == null || !ip.Pools.Any()));
 
+				// Stop if we have enough unassigned addresses
 				if (unassignedIpAddresses.Count >= offset + limit) break;
+
+				// Stop if there are no more addresses to fetch
 				if (allIpAddresses.Next == null) break;
 
+				// Increase the offset so we retrieve the next set of 500 addresses
 				currentOffset += Utils.MaxSendGridPagingLimit;
 			}