diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-03-27 23:42:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-03-27 23:42:21 +0000 |
commit | 2559cde2e88ea9ee8303e74469910677fb8f39c5 (patch) | |
tree | 57d7af12aa10cdf63f5d80b3011d1844111368d6 /include/llvm/CodeGen | |
parent | cf6f4c8c34bb4026fdc1dc455c4362d2c35b495b (diff) | |
download | llvm-2559cde2e88ea9ee8303e74469910677fb8f39c5.tar.gz llvm-2559cde2e88ea9ee8303e74469910677fb8f39c5.tar.bz2 llvm-2559cde2e88ea9ee8303e74469910677fb8f39c5.tar.xz |
PBQP: Minor cleanups to r204857
* Use assignment instead of swap (since the original value is being
destroyed anyway)
* Rename "updateAdjEdgeId" to "setAdjEdgeId"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/PBQP/Graph.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/CodeGen/PBQP/Graph.h b/include/llvm/CodeGen/PBQP/Graph.h index e414c22551..5aac216931 100644 --- a/include/llvm/CodeGen/PBQP/Graph.h +++ b/include/llvm/CodeGen/PBQP/Graph.h @@ -70,12 +70,12 @@ namespace PBQP { void removeAdjEdgeId(Graph &G, NodeId ThisNId, AdjEdgeIdx Idx) { // Swap-and-pop for fast removal. // 1) Update the adj index of the edge currently at back(). - // 2) Swap Edge at Idx with back(). + // 2) Move last Edge down to Idx. // 3) pop_back() - // If Idx == size() - 1 then the updateAdjEdgeIdx and swap are + // If Idx == size() - 1 then the setAdjEdgeIdx and swap are // redundant, but both operations are cheap. - G.getEdge(AdjEdgeIds.back()).updateAdjEdgeIdx(ThisNId, Idx); - std::swap(AdjEdgeIds[Idx], AdjEdgeIds.back()); + G.getEdge(AdjEdgeIds.back()).setAdjEdgeIdx(ThisNId, Idx); + AdjEdgeIds[Idx] = AdjEdgeIds.back(); AdjEdgeIds.pop_back(); } @@ -125,7 +125,7 @@ namespace PBQP { connectToN(G, ThisEdgeId, 1); } - void updateAdjEdgeIdx(NodeId NId, typename NodeEntry::AdjEdgeIdx NewIdx) { + void setAdjEdgeIdx(NodeId NId, typename NodeEntry::AdjEdgeIdx NewIdx) { if (NId == NIds[0]) ThisEdgeAdjIdxs[0] = NewIdx; else { |