Owen Rudge orudge@codeweavers.com writes:
+static LPWSTR generate_namespace_prefix(struct list *namespaces, void *parentMemoryBlock, LPCWSTR uri) +{
- WCHAR formatString[] = { 'u','n','%','d', 0 };
- WCHAR suggestedPrefix[7];
- int i;
- ZeroMemory(suggestedPrefix, sizeof(suggestedPrefix));
- /* Find a unique prefix */
- for (i = 0; i < 1000; i++)
- {
wsprintfW(suggestedPrefix, formatString, i);
if (is_prefix_unique(namespaces, suggestedPrefix))
{
return duplicate_string(parentMemoryBlock, suggestedPrefix);
}
- }
This looks extremely inefficient.