[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-commits
Subject:    svn commit: r799454 -
From:       tabish () apache ! org
Date:       2009-07-30 21:59:24
Message-ID: 20090730215924.D19602388871 () eris ! apache ! org
[Download RAW message or body]

Author: tabish
Date: Thu Jul 30 21:59:24 2009
New Revision: 799454

URL: http://svn.apache.org/viewvc?rev=799454&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=799454&r1=799453&r2=799454&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 21:59:24 2009 @@ -70,8 +70,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 void TimerTaskHeap::upHeap() {
 
-	std::size_t current = heap.size() - 1;
-	std::size_t parent = ( current - 1 ) / 2;
+    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) {
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic