From 89d477b4e15b5fe80e99f02360094bd4e765d079 Mon Sep 17 00:00:00 2001 From: spx Date: Tue, 29 Jan 2013 15:59:08 +0900 Subject: [PATCH] Minor tweaks --- Library/Measure.cpp | 2 +- Library/MeterWindow.cpp | 17 ++++------------- Library/lua/LuaScript.cpp | 5 +---- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index d0fbad1a..2b40783e 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -517,7 +517,7 @@ bool CMeasure::Update() { if (!m_IfAboveCommitted) { - m_IfAboveCommitted= true; // To avoid infinite loop from !Update + m_IfAboveCommitted = true; // To avoid infinite loop from !Update Rainmeter->ExecuteCommand(m_IfAboveAction.c_str(), m_MeterWindow); } } diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 2065f765..de8d3136 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -2205,7 +2205,7 @@ bool CMeterWindow::ReadSkin() m_Meters.push_back(meter); meter->SetRelativeMeter(prevMeter); - if (!m_HasButtons && meter->GetTypeID() == TypeID()) + if (meter->GetTypeID() == TypeID()) { m_HasButtons = true; } @@ -2613,10 +2613,7 @@ bool CMeterWindow::UpdateMeasure(CMeasure* measure, bool force) measure->ReadOptions(m_Parser); } - if (measure->Update()) - { - bUpdate = true; - } + bUpdate = measure->Update(); } return bUpdate; @@ -2644,10 +2641,7 @@ bool CMeterWindow::UpdateMeter(CMeter* meter, bool& bActiveTransition, bool forc meter->ReadOptions(m_Parser); } - if (meter->Update()) - { - bUpdate = true; - } + bUpdate = meter->Update(); } // Update tooltips @@ -3447,10 +3441,7 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) if (screenIndex >= 0 && (screenIndex == 0 || screenIndex <= (int)monitors.size() && monitors[screenIndex-1].active)) { - if (m_AutoSelectScreen) - { - m_AutoSelectScreen = false; - } + m_AutoSelectScreen = false; m_WindowXScreen = m_WindowYScreen = screenIndex; m_WindowXScreenDefined = m_WindowYScreenDefined = screenDefined; diff --git a/Library/lua/LuaScript.cpp b/Library/lua/LuaScript.cpp index 1e5a35c8..0c71bf3c 100644 --- a/Library/lua/LuaScript.cpp +++ b/Library/lua/LuaScript.cpp @@ -138,10 +138,7 @@ bool LuaScript::IsFunction(const char* funcName) // Push the function onto the stack lua_getfield(L, -1, funcName); - if (lua_isfunction(L, -1)) - { - bExists = true; - } + bExists = lua_isfunction(L, -1); // Pop both the table and the function off the stack. lua_pop(L, 2);