win: simplify registry closing in uv_cpu_info()
RegCloseKey() is the first thing executed in both the success and error case, so combine the calls. PR-URL: https://github.com/libuv/libuv/pull/2171 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
110eb817bd
commit
e2baa87b59
@ -684,12 +684,9 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos_ptr, int* cpu_count_ptr) {
|
||||
NULL,
|
||||
(BYTE*)&cpu_brand,
|
||||
&cpu_brand_size);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
RegCloseKey(processor_key);
|
||||
goto error;
|
||||
}
|
||||
|
||||
RegCloseKey(processor_key);
|
||||
if (err != ERROR_SUCCESS)
|
||||
goto error;
|
||||
|
||||
cpu_info = &cpu_infos[i];
|
||||
cpu_info->speed = cpu_speed;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user