Skip to content

Commit 99984fe

Browse files
committed
Populate the string table when reading binary logs. Without it, search doesn't work.
1 parent a25203e commit 99984fe

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/StructuredLogger/Serialization/Binary/BinaryLogReader.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ public static Build Read(string filePath)
1313
{
1414
using (var binaryLogReader = new BinaryLogReader(filePath))
1515
{
16-
return (Build)binaryLogReader.ReadNode();
16+
var build = (Build)binaryLogReader.ReadNode();
17+
var buildStringCache = build.StringTable;
18+
19+
foreach (var stringInstance in binaryLogReader.reader.StringTable)
20+
{
21+
buildStringCache.Intern(stringInstance);
22+
}
23+
24+
return build;
1725
}
1826
}
1927

src/StructuredLogger/Serialization/Binary/TreeBinaryReader.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public TreeBinaryReader(string filePath)
3232
}
3333
}
3434

35+
public string[] StringTable => stringTable;
36+
3537
public void ReadStringArray(Queue<string> array)
3638
{
3739
array.Clear();

0 commit comments

Comments
 (0)