[llvm] r204983 - PBQP: Minor cleanups to r204857
Lang Hames
lhames at gmail.com
Fri Mar 28 17:30:28 PDT 2014
Thanks Dave!
On Thu, Mar 27, 2014 at 4:42 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Author: dblaikie
> Date: Thu Mar 27 18:42:21 2014
> New Revision: 204983
>
> URL: http://llvm.org/viewvc/llvm-project?rev=204983&view=rev
> Log:
> PBQP: Minor cleanups to r204857
>
> * Use assignment instead of swap (since the original value is being
> destroyed anyway)
>
> * Rename "updateAdjEdgeId" to "setAdjEdgeId"
>
> Modified:
> llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h
>
> Modified: llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h?rev=204983&r1=204982&r2=204983&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/PBQP/Graph.h Thu Mar 27 18:42:21 2014
> @@ -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 {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140328/e3d463fa/attachment.html>
More information about the llvm-commits
mailing list