Skip to content

Commit

Permalink
Use getSampleIndexToCallNodeIndexForPreviewFilteredThread.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed Jan 23, 2024
1 parent b13edbb commit cfed73b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/selectors/per-thread/stack-sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ export function getStackAndSampleSelectorsPerThread(
)
);

const getSampleIndexToCallNodeIndexForPreviewFilteredThread: Selector<
Array<IndexIntoCallNodeTable | null>,
> = createSelector(
(state) =>
threadSelectors.getPreviewFilteredSamplesForCallTree(state).stack,
(state) => getCallNodeInfo(state).getStackIndexToCallNodeIndex(),
ProfileData.getSampleIndexToCallNodeIndex
);

const getSampleIndexToCallNodeIndexForTabFilteredThread: Selector<
Array<IndexIntoCallNodeTable | null>,
> = createSelector(
Expand Down Expand Up @@ -302,13 +311,9 @@ export function getStackAndSampleSelectorsPerThread(

const getCallTreeTimings: Selector<CallTree.CallTreeTimings> = createSelector(
threadSelectors.getPreviewFilteredSamplesForCallTree,
getSampleIndexToCallNodeIndexForPreviewFilteredThread,
getCallNodeInfo,
(samples, callNodeInfo) => {
const sampleIndexToCallNodeIndex =
ProfileData.getSampleIndexToCallNodeIndex(
samples.stack,
callNodeInfo.getStackIndexToCallNodeIndex()
);
(samples, sampleIndexToCallNodeIndex, callNodeInfo) => {
const callNodeLeafAndSummary = CallTree.computeCallNodeLeafAndSummary(
samples,
sampleIndexToCallNodeIndex,
Expand Down Expand Up @@ -346,14 +351,10 @@ export function getStackAndSampleSelectorsPerThread(
const getTracedTiming: Selector<CallTree.CallTreeTimings | null> =
createSelector(
threadSelectors.getPreviewFilteredSamplesForCallTree,
getSampleIndexToCallNodeIndexForPreviewFilteredThread,
getCallNodeInfo,
ProfileSelectors.getProfileInterval,
(samples, callNodeInfo, interval) => {
const sampleIndexToCallNodeIndex =
ProfileData.getSampleIndexToCallNodeIndex(
samples.stack,
callNodeInfo.getStackIndexToCallNodeIndex()
);
(samples, sampleIndexToCallNodeIndex, callNodeInfo, interval) => {
const callNodeLeafAndSummary =
CallTree.computeCallNodeTracedLeafAndSummary(
samples,
Expand Down

0 comments on commit cfed73b

Please sign in to comment.