mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
fix: optimization: PVS-Studio warning V831
Replaced 'at()' method with 'operator[]' to improve performance. The 'at()' method performs bounds checking, which can introduce overhead. Using 'operator[]' bypasses this check and can improve performance when you are certain that the index is within bounds. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
1bdc9cf759
commit
f3f872c7a3
6 changed files with 8 additions and 8 deletions
|
|
@ -286,7 +286,7 @@ static std::shared_ptr<UINode> readButton(UiXmlReader& reader, const xml::xmlele
|
|||
|
||||
std::shared_ptr<Button> button;
|
||||
auto& elements = element->getElements();
|
||||
if (!elements.empty() && elements.at(0)->getTag() != "#") {
|
||||
if (!elements.empty() && elements[0]->getTag() != "#") {
|
||||
auto inner = reader.readUINode(element->getElements().at(0));
|
||||
if (inner != nullptr) {
|
||||
button = std::make_shared<Button>(inner, padding);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue