]> granicus.if.org Git - graphviz/commitdiff
tests: SVGAnalyzer: avoid string copy by taking reference instead
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 24 Aug 2022 11:00:07 +0000 (13:00 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 30 Aug 2022 20:17:05 +0000 (22:17 +0200)
tests/svg_analyzer.cpp

index bb352b059d0aa06464feadb2b6f8d4a38f754b72..8230858eb3108598909af627eaa4e2aea1a106ad 100644 (file)
@@ -147,7 +147,7 @@ void SVGAnalyzer::retrieve_graphviz_components_impl(
   if (svg_element.type == SVG::SVGElementType::Group) {
     // The SVG 'class' attribute determines which type of Graphviz element a 'g'
     // element corresponds to
-    const auto class_ = svg_element.attributes.class_;
+    const auto &class_ = svg_element.attributes.class_;
     if (class_ == "graph") {
       m_graphs.emplace_back(svg_element);
     } else if (class_ == "node") {