From 285016b2857ee29f56ca24f73cd10cd193eb58d6 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Mon, 27 Apr 2026 17:36:06 -0700 Subject: [PATCH] =?UTF-8?q?[DequeModule]=20RigidDeque=20replacements=20wit?= =?UTF-8?q?h=20Collections:=20Verify=20that=20the=20source=E2=80=99s=20cou?= =?UTF-8?q?nt=20matches=20its=20contents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift b/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift index d5aa4c64..1da555c1 100644 --- a/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift +++ b/Sources/DequeModule/RigidDeque/RigidDeque+Replacements.swift @@ -497,6 +497,9 @@ extension RigidDeque /* where Element: Copyable */ { items.formIndex(after: &i) } } + precondition( + i == items.endIndex, + "Broken Collection: count doesn't match contents") } #if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW