fix: optimization: PVS-Studio warning V836

Expression's value is copied at variable declaration.
The variable is never modified. Consider declaring it as a reference.

Changed variables to be a reference to avoid unnecessary copy.

Reported by: PVS-Studio

Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
Vyacheslav Ivanov
2024-08-01 23:40:28 +03:00
committed by Pugemon
parent 50a388c539
commit 73e721513c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -203,7 +203,7 @@ static void _readPanel(UiXmlReader& reader, const xml::xmlelement& element, Pane
panel.setMaxLength(element->attr("max-length").asInt());
}
if (element->has("orientation")) {
auto oname = element->attr("orientation").getText();
const auto &oname = element->attr("orientation").getText();
if (oname == "horizontal") {
panel.setOrientation(Orientation::horizontal);
}