Skip to content

Commit 4cd7dcb

Browse files
committed
perf: replace Method class with isDetail property
1 parent 2890036 commit 4cd7dcb

5 files changed

Lines changed: 88 additions & 86 deletions

File tree

log-viewer/modules/Database.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class DatabaseAccess {
3434
const len = children.length;
3535
for (let i = 0; i < len; ++i) {
3636
const child = children[i];
37-
if (child?.exitTypes.length) {
37+
if (child && !child.isDetail) {
3838
stack.push(child);
3939
if (child.timestamp === timestamp) {
4040
return stack;
@@ -61,7 +61,7 @@ export class DatabaseAccess {
6161
results.push(child);
6262
}
6363

64-
if (child?.exitTypes.length) {
64+
if (child && !child.isDetail) {
6565
Array.prototype.push.apply(results, this.getSOQLLines(child));
6666
}
6767
}
@@ -80,7 +80,7 @@ export class DatabaseAccess {
8080
results.push(child);
8181
}
8282

83-
if (child?.exitTypes.length) {
83+
if (child && !child.isDetail) {
8484
// results = results.concat(this.getDMLLines(child));
8585
Array.prototype.push.apply(results, this.getDMLLines(child));
8686
}

log-viewer/modules/__tests__/ApexLogParser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ describe('Line Type Tests', () => {
12641264
'Rows:5',
12651265
]) as LogEvent;
12661266

1267-
if (line.exitTypes.length) {
1267+
if (!line.isDetail) {
12681268
line.exitTypes.forEach((exitType) => {
12691269
const exitCls = lineTypeMap.get(exitType);
12701270
expect(exitCls).not.toBe(null);

log-viewer/modules/parsers/ApexLogParser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class ApexLogParser {
190190
const lineIter = new LineIterator(lineGenerator);
191191

192192
while ((line = lineIter.fetch())) {
193-
if (line.exitTypes.length) {
193+
if (!line.isDetail) {
194194
this.parseTree(line, lineIter, stack);
195195
}
196196
line.parent = rootMethod;
@@ -252,7 +252,7 @@ export class ApexLogParser {
252252
nextLine.parent = currentLine;
253253
currentLine.children.push(nextLine);
254254

255-
if (nextLine.exitTypes.length) {
255+
if (!nextLine.isDetail) {
256256
this.parseTree(nextLine, lineIter, stack);
257257
}
258258
}
@@ -400,7 +400,7 @@ export class ApexLogParser {
400400
continue;
401401
}
402402
const isPkgType = child.type === 'ENTERING_MANAGED_PKG';
403-
if (lastPkg) {
403+
if (lastPkg && !child.isDetail) {
404404
if (isPkgType && child.namespace === lastPkg.namespace) {
405405
// combine adjacent (like) packages
406406
lastPkg.exitStamp = child.exitStamp || child.timestamp;
@@ -412,7 +412,7 @@ export class ApexLogParser {
412412
}
413413
}
414414

415-
if (child.exitTypes.length) {
415+
if (!child.isDetail) {
416416
this.insertPackageWrappers(child);
417417
}
418418

0 commit comments

Comments
 (0)