Skip to content

Commit 7871532

Browse files
perf: evaluate likely condition first
CS-CURVE_SCRVUSD-005.1.TWA.1
1 parent a6e254b commit 7871532

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contracts/TWA.vy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def _take_snapshot(_value: uint256):
107107
@notice Stores a snapshot of the tracked value.
108108
@param _value The value to store.
109109
"""
110-
if (len(self.snapshots) == 0) or ( # First snapshot
110+
if ( # First snapshot
111111
self.last_snapshot_timestamp + self.min_snapshot_dt_seconds <= block.timestamp # after dt
112-
):
112+
) or (len(self.snapshots) == 0):
113113
self.last_snapshot_timestamp = block.timestamp
114114
self.snapshots.append(
115115
Snapshot(tracked_value=_value, timestamp=block.timestamp)

0 commit comments

Comments
 (0)