summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2019-06-22 12:52:01 +1000
committerDamien Zammit <damien@zamaudio.com>2019-06-22 12:52:01 +1000
commitea2a1744a6aeb8d4411586de524952209c263c2f (patch)
tree21274531da2c1c9bb3f203ff54aa195e48e40203
parent140f0d7b65559e9cf6a641c02361289caeb32e01 (diff)
Limit nesting to 5 levels deep, speeds up loading a particular session from 36s to 0.6s
-rw-r--r--ptformat.cc3
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;