aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-10-26 20:29:39 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-10-26 20:29:39 -0700
commit3a6fa9cdf581dd3f7f8156190f33d2617c156cd6 (patch)
tree667733ac4df64e3fd4d583598e9a7900ea7efec9 /src
parent252ecdeeae6847f44bec5eeb5919040c9bce9ca9 (diff)
downloadgeniza-3a6fa9cdf581dd3f7f8156190f33d2617c156cd6.tar.gz
geniza-3a6fa9cdf581dd3f7f8156190f33d2617c156cd6.zip
fix append() bug in register code
Diffstat (limited to 'src')
-rw-r--r--src/register.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/register.rs b/src/register.rs
index 9dd2291..95695ce 100644
--- a/src/register.rs
+++ b/src/register.rs
@@ -398,7 +398,7 @@ impl HyperRegister for SleepDirRegister {
self.tree_sleep.read(right)?);
let parent_hash = HyperRegister::hash_parent(&left[0..40], &right[0..40]);
self.tree_sleep.write(parent, &parent_hash[0..40])?;
- parent = HyperRegister::tree_parent_index(index);
+ parent = HyperRegister::tree_parent_index(parent);
}
// 4. Add signature to signature file
@@ -505,9 +505,8 @@ fn test_sdr_append() {
sdr.check().unwrap();
assert_eq!(sdr.len().unwrap(), 1);
assert_eq!(sdr.len_bytes().unwrap(), 12);
- // XXX: some bug here around >= 5 (?)
- let count = 4; // make this ~1000 when things are faster
- for i in 0..count {
+ let count = 100; // TODO: make this >1000 when things are faster
+ for _ in 0..count {
sdr.append(&[1,2,3,4,5]).unwrap();
}
sdr.check().unwrap();