[2/3] wsdapi: Implement AddNamespace, AddNameToNamespace.

Alexandre Julliard julliard at winehq.org
Wed May 17 12:04:23 CDT 2017


Owen Rudge <orudge at 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.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list