From 54dbf3aa1c32bd19c05575a4ea7825a79d44b4e5 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Fri, 24 Jun 2011 16:23:13 -0400 Subject: [PATCH] QueryPlanSet::Runner::mayYield cleaning --- db/queryoptimizer.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/db/queryoptimizer.cpp b/db/queryoptimizer.cpp index cb99743d2a0..4173eaaa2cd 100644 --- a/db/queryoptimizer.cpp +++ b/db/queryoptimizer.cpp @@ -626,18 +626,21 @@ doneCheckOrder: } void QueryPlanSet::Runner::mayYield() { - if ( _plans._mayYield ) { - if ( _plans._yieldSometimesTracker.ping() ) { - int micros = ClientCursor::yieldSuggest(); - if ( micros > 0 ) { - if ( !prepareToYield() ) { - return; - } - ClientCursor::staticYield( micros , _plans._ns , 0 ); - recoverFromYield(); - } - } - } + if ( ! _plans._mayYield ) + return; + + if ( ! _plans._yieldSometimesTracker.ping() ) + return; + + int micros = ClientCursor::yieldSuggest(); + if ( micros <= 0 ) + return; + + if ( !prepareToYield() ) + return; + + ClientCursor::staticYield( micros , _plans._ns , 0 ); + recoverFromYield(); } shared_ptr QueryPlanSet::Runner::init() {