Browse Source

FramerateManager.cpp: Merge this "if" statement with the enclosing one.

Collapsible "if" statements should be merged
Alexander Wilms 2 years ago
parent
commit
3616235bb5
1 changed files with 2 additions and 5 deletions
  1. 2 5
      client/gui/FramerateManager.cpp

+ 2 - 5
client/gui/FramerateManager.cpp

@@ -28,13 +28,10 @@ void FramerateManager::framerateDelay()
 {
 	Duration timeSpentBusy = Clock::now() - lastTimePoint;
 
-	if(!vsyncEnabled)
+	if(!vsyncEnabled && timeSpentBusy < targetFrameTime)
 	{
 		// if FPS is higher than it should be, then wait some time
-		if(timeSpentBusy < targetFrameTime)
-		{
-			boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
-		}
+		boost::this_thread::sleep_for(targetFrameTime - timeSpentBusy);
 	}
 
 	// compute actual timeElapsed taking into account actual sleep interval