mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: optimization: PVS-Studio warning V830
Replaced 'std::optional::value()' with '*' operator to improve performance. Using 'std::optional::value()' involves additional overhead compared to using the '*' or '->' operators. This change ensures more efficient access to the underlying value of the optional when you are certain that it contains a value. Reported by: PVS-Studio Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
8c5e5559ec
commit
3fa7fac4df
1 changed files with 1 additions and 1 deletions
|
|
@ -455,7 +455,7 @@ void PlayerController::updateEntityInteraction(entityid_t eid, bool lclick, bool
|
||||||
if (!entityOpt.has_value()) {
|
if (!entityOpt.has_value()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto entity = entityOpt.value();
|
auto entity = *entityOpt;
|
||||||
if (lclick) {
|
if (lclick) {
|
||||||
scripting::on_attacked(entity, player.get(), player->getEntity());
|
scripting::on_attacked(entity, player.get(), player->getEntity());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue