We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5be43bf commit 680010dCopy full SHA for 680010d
stackslib/src/chainstate/stacks/index/trie.rs
@@ -378,13 +378,8 @@ impl Trie {
378
// append the new leaf and the end of the file.
379
let new_leaf_disk_ptr = storage.last_ptr()?;
380
let new_leaf_chr = cursor.path[cursor.tell()]; // NOTE: this is safe because !cursor.eop()
381
- let new_leaf_path = cursor.path[(if cursor.tell() < cursor.path.len() {
382
- cursor.tell() + 1
383
- } else {
384
- cursor.path.len()
385
- })..]
386
- .to_vec();
387
- new_leaf_data.path = new_leaf_path;
+ new_leaf_data.path =
+ cursor.path[std::cmp::min(cursor.tell() + 1, cursor.path.len())..].to_vec();
388
let new_leaf_hash = get_leaf_hash(new_leaf_data);
389
390
// put new leaf at the end of this Trie
0 commit comments