static void PopulateAllUniqueDomains(StringBuilder buf, Dictionary <string, Regex> allUniqueDomains, params string[][] allDomains) { // Setup variables int listIndex = 0, stringIndex = 0; // Clear the dictionary allUniqueDomains.Clear(); if (allDomains != null) { // Go through all the domains for (; listIndex < allDomains.Length; ++listIndex) { if (allDomains[listIndex] != null) { // Go through all strings in the list for (stringIndex = 0; stringIndex < allDomains[listIndex].Length; ++stringIndex) { // Add the entry and its regular expression equivalent if (string.IsNullOrEmpty(allDomains[listIndex][stringIndex]) == false) { allUniqueDomains.Add(allDomains[listIndex][stringIndex], DomainList.ConvertToRegex(allDomains[listIndex][stringIndex], buf)); } } } } } }