]> granicus.if.org Git - graphviz/commitdiff
put VPSC’s Node class in an anonymous namespace
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 22 May 2021 04:28:32 +0000 (21:28 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 29 May 2021 00:02:43 +0000 (17:02 -0700)
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.

lib/vpsc/generate-constraints.cpp

index 485cc08c2ec2f4a3e2ad55953cc1bf0ac58870ff..7349bf57193db719bc89cadbcfd4422d10e91465 100644 (file)
@@ -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;