From 867a989a6d562214397ba968c7d52c0347a3f08f Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Sat, 12 Oct 2019 20:01:42 +0200 Subject: [PATCH] DevicesHandler::toggleNic(): remove variable by calling GetLastError() directly The value returned by GetLastError() was only used one time, there is no need to store it in a variable. --- DevicesHandler.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DevicesHandler.cpp b/DevicesHandler.cpp index d5aacf9..9a94963 100755 --- a/DevicesHandler.cpp +++ b/DevicesHandler.cpp @@ -126,9 +126,7 @@ bool DevicesHandler::toggleNic(const unsigned long &index, const Action &action) } if (!SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, handle, &deviceInfoData)) { - const DWORD err = GetLastError(); - - std::cout << "DevicesHandler::toggleNic(): SetupDiCallClassInstaller() failed with error: " << err << std::endl; + std::cout << "DevicesHandler::toggleNic(): SetupDiCallClassInstaller() failed with error: " << GetLastError() << std::endl; // Clear parameters, otherwise the device remains in an inconsistent state (e.g. with the enabled icon even if disabled). SetupDiSetClassInstallParams(handle, &deviceInfoData, nullptr, 0);