chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a92b24
)
zccord: Fix a panic in some iteration cases
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 10 Jul 2021 17:36:07 +0000
(18:36 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 10 Jul 2021 18:28:56 +0000
(19:28 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base/zcoord.rs
patch
|
blob
|
history
diff --git
a/base/zcoord.rs
b/base/zcoord.rs
index a7a5fb31704f5bf9b52f4b80d8ae383a29e660db..9ab0368303cd54e1ec477d32f338bf732c9c27b2 100644
(file)
--- a/
base/zcoord.rs
+++ b/
base/zcoord.rs
@@
-369,7
+369,7
@@
impl Mutable {
*self.limbs.get(i).unwrap_or(&ZERO)
}
fn extend_to_limb(&mut self, i: usize) {
- if self.limbs.len() < i {
+ if self.limbs.len() <
=
i {
self.limbs.resize(i+1, ZERO);
}
}