Skip to content

Commit f0f61ba

Browse files
committed
Fixup for speedup code from a few commits ago - whoops
1 parent b0a791d commit f0f61ba

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/dtsc.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,7 @@ namespace DTSC{
13861386

13871387
t.pageAvailField = t.pages.getFieldData("avail");
13881388
t.pageFirstKeyField = t.pages.getFieldData("firstkey");
1389+
t.pageFirstTimeField = t.pages.getFieldData("firsttime");
13891390
}
13901391
}
13911392
}
@@ -1498,6 +1499,7 @@ namespace DTSC{
14981499

14991500
t.pageAvailField = t.pages.getFieldData("avail");
15001501
t.pageFirstKeyField = t.pages.getFieldData("firstkey");
1502+
t.pageFirstTimeField = t.pages.getFieldData("firsttime");
15011503
}
15021504

15031505
}
@@ -2084,6 +2086,7 @@ namespace DTSC{
20842086
t.pages.setReady();
20852087
t.pageAvailField = t.pages.getFieldData("avail");
20862088
t.pageFirstKeyField = t.pages.getFieldData("firstkey");
2089+
t.pageFirstTimeField = t.pages.getFieldData("firsttime");
20872090
}
20882091

20892092
/// Sets the given track's init data.
@@ -3479,11 +3482,11 @@ namespace DTSC{
34793482
uint64_t endPos = pages.getEndPos();
34803483
for (uint64_t i = res; i < endPos; ++i){
34813484
if (pages.getInt(t.pageAvailField, i) == 0) { continue; }
3482-
if (pages.getInt(t.pageFirstKeyField, i) > time) { break; }
3485+
if (pages.getInt(t.pageFirstTimeField, i) > time) { break; }
34833486
res = i;
34843487
}
34853488
DONTEVEN_MSG("Page number for time %" PRIu64 " on track %" PRIu32 " can be found on page %" PRIu64, time, idx, pages.getInt("firstkey", res));
3486-
return pages.getInt("firstkey", res);
3489+
return pages.getInt(t.pageFirstKeyField, res);
34873490
}
34883491

34893492
/// Given a key, returns the page number it can be found on.

lib/dtsc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ namespace DTSC{
235235

236236
Util::RelAccXFieldData pageAvailField;
237237
Util::RelAccXFieldData pageFirstKeyField;
238+
Util::RelAccXFieldData pageFirstTimeField;
238239

239240
Util::RelAccXFieldData framesTimeField;
240241
Util::RelAccXFieldData framesSizeField;

0 commit comments

Comments
 (0)