17 May
2017
17 May
'17
5:04 p.m.
Owen Rudge <orudge(a)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(a)winehq.org