From: Magnus Jacobsson Date: Wed, 24 Aug 2022 11:00:07 +0000 (+0200) Subject: tests: SVGAnalyzer: avoid string copy by taking reference instead X-Git-Tag: 6.0.1~15^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=776a0e1bf3f49249f87f5b0cfd66645509666ee0;p=graphviz tests: SVGAnalyzer: avoid string copy by taking reference instead --- diff --git a/tests/svg_analyzer.cpp b/tests/svg_analyzer.cpp index bb352b059..8230858eb 100644 --- a/tests/svg_analyzer.cpp +++ b/tests/svg_analyzer.cpp @@ -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") {