Ticket 37. In the TariffChangeIsAllowed() function return "" added and
authorElena Mamontova <helenh463@gmail.com>
Mon, 12 Dec 2016 13:18:05 +0000 (15:18 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Thu, 22 Dec 2016 19:33:14 +0000 (21:33 +0200)
unnecessary brackets removed in the if (currentTime > timeout && timeout != 0).

projects/stargazer/tariff_impl.cpp

index 2daaeeb..7dbae0d 100644 (file)
@@ -148,7 +148,7 @@ else
 std::string TARIFF_IMPL::TariffChangeIsAllowed(const TARIFF & to, time_t currentTime) const
 {
 time_t timeout = GetChangePolicyTimeout();
-if ((currentTime > timeout) && (timeout != 0))
+if (currentTime > timeout && timeout != 0)
     return "";
 switch (GetChangePolicy())
     {
@@ -167,5 +167,6 @@ switch (GetChangePolicy())
     case TARIFF::DENY:
         return "Current tariff '" + GetName() + "', new tariff '" + to.GetName() + "'. The policy is '" + TARIFF::ChangePolicyToString(GetChangePolicy()) + "'.";
     }
+return "";
 }
 //-----------------------------------------------------------------------------