From: Matthew Fernandez Date: Sat, 22 May 2021 04:28:32 +0000 (-0700) Subject: put VPSC’s Node class in an anonymous namespace X-Git-Tag: 2.47.3~25^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=329c674817d06f874246f465c3fb9840e5494809;p=graphviz put VPSC’s Node class in an anonymous namespace This marks the class as unnecessary outside of its containing translation unit. This further emphasizes that is is an implementation detail of the containing file as well as allowing the compiler to aggressively optimize its layout. --- diff --git a/lib/vpsc/generate-constraints.cpp b/lib/vpsc/generate-constraints.cpp index 485cc08c2..7349bf571 100644 --- a/lib/vpsc/generate-constraints.cpp +++ b/lib/vpsc/generate-constraints.cpp @@ -37,6 +37,7 @@ Rectangle::Rectangle(double x, double X, double y, double Y) assert(y<=Y); } +namespace { struct Node; struct CmpNodePos { bool operator()(const Node* u, const Node* v) const; }; @@ -78,6 +79,7 @@ bool CmpNodePos::operator() (const Node* u, const Node* v) const { } return u < v; } +} static NodeSet getLeftNeighbours(NodeSet &scanline,Node *v) { NodeSet leftv;