From: Justin Holewinski Date: Wed, 20 Mar 2013 23:10:59 +0000 (+0000) Subject: Make variable name more explicit and eliminate redundant lookup in SDNodeOrdering X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=93c1fd49d2ca49447e092c4c1c4d5de1005e9e71;p=oota-llvm.git Make variable name more explicit and eliminate redundant lookup in SDNodeOrdering git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177600 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SDNodeOrdering.h b/lib/CodeGen/SelectionDAG/SDNodeOrdering.h index 74010a8096c..7e7b8974be4 100644 --- a/lib/CodeGen/SelectionDAG/SDNodeOrdering.h +++ b/lib/CodeGen/SelectionDAG/SDNodeOrdering.h @@ -33,10 +33,10 @@ class SDNodeOrdering { public: SDNodeOrdering() {} - void add(const SDNode *Node, unsigned O) { - unsigned OldOrder = getOrder(Node); - if (OldOrder == 0 || (OldOrder > 0 && O < OldOrder)) - OrderMap[Node] = O; + void add(const SDNode *Node, unsigned NewOrder) { + unsigned &OldOrder = OrderMap[Node]; + if (OldOrder == 0 || (OldOrder > 0 && NewOrder < OldOrder)) + OldOrder = NewOrder; } void remove(const SDNode *Node) { DenseMap::iterator Itr = OrderMap.find(Node);