From 129ace8e24cd46b7a3aa7f4f522cb0154da89afd Mon Sep 17 00:00:00 2001 From: mootz12 Date: Wed, 25 Mar 2026 16:33:27 -0400 Subject: [PATCH] chore: use saturating sub with max_ttl computation --- soroban-sdk/src/storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soroban-sdk/src/storage.rs b/soroban-sdk/src/storage.rs index 122714faa..fa805a66a 100644 --- a/soroban-sdk/src/storage.rs +++ b/soroban-sdk/src/storage.rs @@ -153,7 +153,7 @@ impl Storage { pub fn max_ttl(&self) -> u32 { let seq = self.env.ledger().sequence(); let max = self.env.ledger().max_live_until_ledger(); - max - seq + max.saturating_sub(seq) } /// Returns if there is a value stored for the given key in the currently