"James Hawkins" truiken@gmail.com wrote:
- static const WCHAR emptyW[] = {0};
- if (!name || !strcmpW(name, emptyW)) {
*retkey = hkey;
return ERROR_SUCCESS;
- }
- if (!name || !strcmp(name, "")) {
*retkey = hkey;
return ERROR_SUCCESS;
- }
Instead of introducing emptyW and calling strcmp[W] with an empty string it's much simpler and more readable to use in both cases:
if (!name || !*name) { *retkey = hkey; return ERROR_SUCCESS; }