mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 15:37:54 -05:00
Use orElseGet for efficiency, address comment of previous PR 8139 (#8145)
Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
This commit is contained in:
committed by
GitHub
parent
a54c46a131
commit
113cf8b2a9
@@ -402,8 +402,11 @@ public class TransactionSimulator {
|
||||
final long nonce =
|
||||
callParams
|
||||
.getNonce()
|
||||
.orElse(
|
||||
Optional.ofNullable(updater.get(senderAddress)).map(Account::getNonce).orElse(0L));
|
||||
.orElseGet(
|
||||
() ->
|
||||
Optional.ofNullable(updater.get(senderAddress))
|
||||
.map(Account::getNonce)
|
||||
.orElse(0L));
|
||||
|
||||
final long simulationGasCap =
|
||||
calculateSimulationGasCap(callParams.getGasLimit(), blockHeaderToProcess.getGasLimit());
|
||||
|
||||
Reference in New Issue
Block a user