You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/07/31 00:16:16 UTC

svn commit: r799458 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp

Author: tabish
Date: Thu Jul 30 22:16:15 2009
New Revision: 799458

URL: http://svn.apache.org/viewvc?rev=799458&view=rev
Log:
64bit OS fix

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp?rev=799458&r1=799457&r2=799458&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp Thu Jul 30 22:16:15 2009
@@ -70,14 +70,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 void TimerTaskHeap::upHeap() {
 
-    if( heap.size() <= 1 ) {
-        return;  // Can't get any higher than the top.
-    }
-
     std::size_t current = heap.size() - 1;
     std::size_t parent = ( current - 1 ) / 2;
 
-    while( heap[current]->when < heap[parent]->when) {
+    while( current != 0 && heap[current]->when < heap[parent]->when) {
 
         // swap the two
         Pointer<TimerTask> tmp = heap[current];