diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-10-26 20:29:39 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-10-26 20:29:39 -0700 |
commit | 3a6fa9cdf581dd3f7f8156190f33d2617c156cd6 (patch) | |
tree | 667733ac4df64e3fd4d583598e9a7900ea7efec9 | |
parent | 252ecdeeae6847f44bec5eeb5919040c9bce9ca9 (diff) | |
download | geniza-3a6fa9cdf581dd3f7f8156190f33d2617c156cd6.tar.gz geniza-3a6fa9cdf581dd3f7f8156190f33d2617c156cd6.zip |
fix append() bug in register code
-rw-r--r-- | src/register.rs | 7 |
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(); |