From df820cf6d4f0c4f5c860690df346b0dce8039e0f Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 14 Jul 2012 17:54:17 +0200 Subject: Efficiently check for emptiness --- src/build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.cc b/src/build.cc index eed52ae..0fc387c 100644 --- a/src/build.cc +++ b/src/build.cc @@ -465,7 +465,7 @@ void RealCommandRunner::Abort() { bool RealCommandRunner::CanRunMore() { return ((int)subprocs_.running_.size()) < config_.parallelism - && ((subprocs_.running_.size() == 0 || config_.max_load_average <= 0.0f) + && ((subprocs_.running_.empty() || config_.max_load_average <= 0.0f) || GetLoadAverage() < config_.max_load_average); } -- cgit v0.12