Skip to content

Commit 33c7c7a

Browse files
enitratSamWilsn
authored andcommitted
inline condition
1 parent 8c24b42 commit 33c7c7a

File tree

13 files changed

+13
-52
lines changed

13 files changed

+13
-52
lines changed

src/ethereum/arrow_glacier/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

src/ethereum/berlin/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

src/ethereum/byzantium/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,7 @@ def is_account_alive(state: State, address: Address) -> bool:
434434
True if the account is alive.
435435
"""
436436
account = get_account_optional(state, address)
437-
if account is None:
438-
return False
439-
else:
440-
return not account == EMPTY_ACCOUNT
437+
return account is not None and account != EMPTY_ACCOUNT
441438

442439

443440
def modify_state(

src/ethereum/cancun/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,7 @@ def is_account_alive(state: State, address: Address) -> bool:
493493
True if the account is alive.
494494
"""
495495
account = get_account_optional(state, address)
496-
if account is None:
497-
return False
498-
else:
499-
return not account == EMPTY_ACCOUNT
496+
return account is not None and account != EMPTY_ACCOUNT
500497

501498

502499
def modify_state(

src/ethereum/constantinople/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,7 @@ def is_account_alive(state: State, address: Address) -> bool:
434434
True if the account is alive.
435435
"""
436436
account = get_account_optional(state, address)
437-
if account is None:
438-
return False
439-
else:
440-
return not account == EMPTY_ACCOUNT
437+
return account is not None and account != EMPTY_ACCOUNT
441438

442439

443440
def modify_state(

src/ethereum/gray_glacier/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

src/ethereum/istanbul/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

src/ethereum/london/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

src/ethereum/muir_glacier/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

src/ethereum/paris/state.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,7 @@ def is_account_alive(state: State, address: Address) -> bool:
460460
True if the account is alive.
461461
"""
462462
account = get_account_optional(state, address)
463-
if account is None:
464-
return False
465-
else:
466-
return not account == EMPTY_ACCOUNT
463+
return account is not None and account != EMPTY_ACCOUNT
467464

468465

469466
def modify_state(

0 commit comments

Comments
 (0)