From 5fc4a4b773690d87956f54aa5ce787ebd7dea08f Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sun, 22 Oct 2023 21:07:17 -0400 Subject: [PATCH] Stop using sampleCallNodes in ThreadSampleGraph. --- src/components/shared/thread/SampleGraph.js | 12 ++---------- src/components/timeline/TrackThread.js | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/components/shared/thread/SampleGraph.js b/src/components/shared/thread/SampleGraph.js index 5a73559b6b..9b2525495e 100644 --- a/src/components/shared/thread/SampleGraph.js +++ b/src/components/shared/thread/SampleGraph.js @@ -6,7 +6,6 @@ import React, { PureComponent } from 'react'; import classNames from 'classnames'; import { InView } from 'react-intersection-observer'; -import { ensureExists } from 'firefox-profiler/utils/flow'; import { timeCode } from 'firefox-profiler/utils/time-code'; import { getSampleIndexClosestToCenteredTime } from 'firefox-profiler/profile-logic/profile-data'; import { bisectionRight } from 'firefox-profiler/utils/bisect'; @@ -20,7 +19,6 @@ import type { CategoryList, IndexIntoSamplesTable, Milliseconds, - IndexIntoCallNodeTable, SelectedState, } from 'firefox-profiler/types'; import type { SizeProps } from 'firefox-profiler/components/shared/WithSize'; @@ -29,7 +27,6 @@ type Props = {| +className: string, +thread: Thread, +samplesSelectedStates: null | SelectedState[], - +sampleCallNodes: Array, +interval: Milliseconds, +rangeStart: Milliseconds, +rangeEnd: Milliseconds, @@ -95,7 +92,6 @@ export class ThreadSampleGraphImpl extends PureComponent { rangeStart, rangeEnd, samplesSelectedStates, - sampleCallNodes, categories, width, height, @@ -144,8 +140,8 @@ export class ThreadSampleGraphImpl extends PureComponent { if (sampleTime < nextMinTime) { continue; } - const callNodeIndex = sampleCallNodes[i]; - if (callNodeIndex === null) { + const stackIndex = thread.samples.stack[i]; + if (stackIndex === null) { continue; } const xPos = @@ -157,10 +153,6 @@ export class ThreadSampleGraphImpl extends PureComponent { ) { samplesBucket = highlightedSamples; } else { - const stackIndex = ensureExists( - thread.samples.stack[i], - 'A stack must exist for this sample, since a callNodeIndex exists.' - ); const categoryIndex = thread.stackTable.category[stackIndex]; const category = categories[categoryIndex]; if (category.name === 'Idle') { diff --git a/src/components/timeline/TrackThread.js b/src/components/timeline/TrackThread.js index f8113c075c..3e7935ed8c 100644 --- a/src/components/timeline/TrackThread.js +++ b/src/components/timeline/TrackThread.js @@ -285,7 +285,6 @@ class TimelineTrackThreadImpl extends PureComponent { thread={filteredThread} rangeStart={rangeStart} rangeEnd={rangeEnd} - sampleCallNodes={sampleCallNodes} samplesSelectedStates={samplesSelectedStates} categories={categories} onSampleClick={this._onSampleClick}