Skip to content

Commit 02df99b

Browse files
authored
Pass callNodeInfo to handleCallNodeTransformShortcut. (#6115)
The function handleCallNodeTransformShortcut takes a call node index as a parameter, but it was getting the call node info separately from a selector. At the moment that's fine because this is always the right call node info. But once we add separate call node infos for things like "the callees of the selected function in the function list", the two might get out of sync, so it's better to pass the correct call node info that is compatible with the passed call node index. Functionally-neutral change.
2 parents 6725c89 + 2cfc425 commit 02df99b

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/actions/profile-view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,6 +2015,7 @@ export function toggleBottomBoxFullscreen(): ThunkAction<void> {
20152015
export function handleCallNodeTransformShortcut(
20162016
event: React.KeyboardEvent<HTMLElement>,
20172017
threadsKey: ThreadsKey,
2018+
callNodeInfo: CallNodeInfo,
20182019
callNodeIndex: IndexIntoCallNodeTable
20192020
): ThunkAction<void> {
20202021
return (dispatch, getState) => {
@@ -2023,7 +2024,6 @@ export function handleCallNodeTransformShortcut(
20232024
}
20242025
const threadSelectors = getThreadSelectorsFromThreadsKey(threadsKey);
20252026
const unfilteredThread = threadSelectors.getThread(getState());
2026-
const callNodeInfo = threadSelectors.getCallNodeInfo(getState());
20272027
const implementation = getImplementationFilter(getState());
20282028
const inverted = getInvertCallstack(getState());
20292029
const callNodePath = callNodeInfo.getCallNodePathFromIndex(callNodeIndex);

src/components/calltree/CallTree.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ class CallTreeImpl extends PureComponent<Props> {
276276
rightClickedCallNodeIndex,
277277
handleCallNodeTransformShortcut,
278278
threadsKey,
279+
callNodeInfo,
279280
} = this.props;
280281
const nodeIndex =
281282
rightClickedCallNodeIndex !== null
@@ -284,7 +285,7 @@ class CallTreeImpl extends PureComponent<Props> {
284285
if (nodeIndex === null) {
285286
return;
286287
}
287-
handleCallNodeTransformShortcut(event, threadsKey, nodeIndex);
288+
handleCallNodeTransformShortcut(event, threadsKey, callNodeInfo, nodeIndex);
288289
};
289290

290291
_onEnterOrDoubleClick = (nodeId: IndexIntoCallNodeTable) => {

src/components/flame-graph/FlameGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class FlameGraphImpl
298298
return;
299299
}
300300

301-
handleCallNodeTransformShortcut(event, threadsKey, nodeIndex);
301+
handleCallNodeTransformShortcut(event, threadsKey, callNodeInfo, nodeIndex);
302302
};
303303

304304
_onCopy = (event: ClipboardEvent) => {

src/components/stack-chart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class StackChartImpl extends React.PureComponent<Props> {
179179
return;
180180
}
181181

182-
handleCallNodeTransformShortcut(event, threadsKey, nodeIndex);
182+
handleCallNodeTransformShortcut(event, threadsKey, callNodeInfo, nodeIndex);
183183
};
184184

185185
_onDoubleClick = (callNodeIndex: IndexIntoCallNodeTable | null) => {

0 commit comments

Comments
 (0)