diff options
author | Damien Zammit <damien@zamaudio.com> | 2019-06-22 12:52:01 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2019-06-22 12:52:01 +1000 |
commit | ea2a1744a6aeb8d4411586de524952209c263c2f (patch) | |
tree | 21274531da2c1c9bb3f203ff54aa195e48e40203 /ptformat.cc | |
parent | 140f0d7b65559e9cf6a641c02361289caeb32e01 (diff) |
Limit nesting to 5 levels deep, speeds up loading a particular session from 36s to 0.6s
Diffstat (limited to 'ptformat.cc')
-rw-r--r-- | ptformat.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ptformat.cc b/ptformat.cc index aa96ca9..2fdc2db 100644 --- a/ptformat.cc +++ b/ptformat.cc @@ -573,7 +573,7 @@ PTFFormat::parse_block_at(uint32_t pos, struct block_t *block, int level) { if (pos + 7 > _len) return false; - if (level > 10) + if (level > 5) return false; if (_ptfunxored[pos] != ZMARK) return false; @@ -594,6 +594,7 @@ PTFFormat::parse_block_at(uint32_t pos, struct block_t *block, int level) { block->block_size = b.block_size; block->content_type = b.content_type; block->offset = b.offset; + memset(&block->child, 0, sizeof(block->child)); for (i = 1; (i < block->block_size) && (pos + i + childjump < _len); i += childjump ? childjump : 1) { int p = pos + i; |