From 5423cff7a85e68025a9cd8484aa1814a714258af Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Wed, 19 Sep 2012 11:25:51 +0200 Subject: [PATCH] Removing old style cast --- DataStructures/BinaryHeap.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DataStructures/BinaryHeap.h b/DataStructures/BinaryHeap.h index f99f09b8e..85c14d456 100644 --- a/DataStructures/BinaryHeap.h +++ b/DataStructures/BinaryHeap.h @@ -117,14 +117,14 @@ public: } Key Size() const { - return ( Key )( heap.size() - 1 ); + return static_cast( heap.size() - 1 ); } void Insert( NodeID node, Weight weight, const Data &data ) { HeapElement element; - element.index = ( NodeID ) insertedNodes.size(); + element.index = static_cast(insertedNodes.size()); element.weight = weight; - const Key key = ( Key ) heap.size(); + const Key key = static_cast(heap.size()); heap.push_back( element ); insertedNodes.push_back( HeapNode( node, key, weight, data ) ); nodeIndex[node] = element.index; @@ -150,7 +150,7 @@ public: bool WasInserted( NodeID node ) { const Key index = nodeIndex[node]; - if ( index >= ( Key ) insertedNodes.size() ) + if ( index >= static_cast (insertedNodes.size()) ) return false; return insertedNodes[index].node == node; } @@ -218,9 +218,9 @@ private: const Key droppingIndex = heap[key].index; const Weight weight = heap[key].weight; Key nextKey = key << 1; - while ( nextKey < ( Key ) heap.size() ) { + while ( nextKey < static_cast( heap.size() ) ) { const Key nextKeyOther = nextKey + 1; - if ( ( nextKeyOther < ( Key ) heap.size() )&& ( heap[nextKey].weight > heap[nextKeyOther].weight) ) + if ( ( nextKeyOther < static_cast ( heap.size() ) )&& ( heap[nextKey].weight > heap[nextKeyOther].weight) ) nextKey = nextKeyOther; if ( weight <= heap[nextKey].weight )