break out of the first inner loop if constants contains no key in remove_constant_indices (#816)

This commit is contained in:
Mark Thom
2021-02-10 14:13:37 -07:00
parent ce8490ed41
commit 2db1fac1eb

View File

@@ -561,15 +561,15 @@ pub fn remove_constant_indices(
constants_index = index; constants_index = index;
match constants.get(constant).cloned() { match constants.get(constant).cloned() {
Some(IndexingCodePtr::External(_)) => { Some(IndexingCodePtr::External(_)) | Some(IndexingCodePtr::Fail) => {
constants.remove(constant); constants.remove(constant);
break; break;
} }
Some(IndexingCodePtr::Internal(o)) => { Some(IndexingCodePtr::Internal(o)) => {
index += o; index += o;
} }
Some(IndexingCodePtr::Fail) | None => { None => {
unreachable!() break;
} }
} }
} }