From 2db1fac1ebb2dd2446e8c52a11e960da92557d06 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Wed, 10 Feb 2021 14:13:37 -0700 Subject: [PATCH] break out of the first inner loop if constants contains no key in remove_constant_indices (#816) --- src/indexing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/indexing.rs b/src/indexing.rs index 14b5f356..90f1b2b3 100644 --- a/src/indexing.rs +++ b/src/indexing.rs @@ -561,15 +561,15 @@ pub fn remove_constant_indices( constants_index = index; match constants.get(constant).cloned() { - Some(IndexingCodePtr::External(_)) => { + Some(IndexingCodePtr::External(_)) | Some(IndexingCodePtr::Fail) => { constants.remove(constant); break; } Some(IndexingCodePtr::Internal(o)) => { index += o; } - Some(IndexingCodePtr::Fail) | None => { - unreachable!() + None => { + break; } } } -- 2.54.0