Skip to content

Commit

Permalink
remove unused argument to applyPatch (#69376)
Browse files Browse the repository at this point in the history
While refactoring router stuff, I noticed `flightSegmentPath` wasn't
being used by `applyPatch`.
  • Loading branch information
ztanner authored Aug 27, 2024
1 parent 7f57d4b commit 678b487
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-par
*/
function applyPatch(
initialTree: FlightRouterState,
patchTree: FlightRouterState,
flightSegmentPath: FlightSegmentPath
patchTree: FlightRouterState
): FlightRouterState {
const [initialSegment, initialParallelRoutes] = initialTree
const [patchSegment, patchParallelRoutes] = patchTree
Expand All @@ -34,8 +33,7 @@ function applyPatch(
if (isInPatchTreeParallelRoutes) {
newParallelRoutes[key] = applyPatch(
initialParallelRoutes[key],
patchParallelRoutes[key],
flightSegmentPath
patchParallelRoutes[key]
)
} else {
newParallelRoutes[key] = initialParallelRoutes[key]
Expand Down Expand Up @@ -87,11 +85,7 @@ export function applyRouterStatePatchToTree(

// Root refresh
if (flightSegmentPath.length === 1) {
const tree: FlightRouterState = applyPatch(
flightRouterState,
treePatch,
flightSegmentPath
)
const tree: FlightRouterState = applyPatch(flightRouterState, treePatch)

addRefreshMarkerToActiveParallelSegments(tree, path)

Expand All @@ -109,11 +103,7 @@ export function applyRouterStatePatchToTree(

let parallelRoutePatch
if (lastSegment) {
parallelRoutePatch = applyPatch(
parallelRoutes[parallelRouteKey],
treePatch,
flightSegmentPath
)
parallelRoutePatch = applyPatch(parallelRoutes[parallelRouteKey], treePatch)
} else {
parallelRoutePatch = applyRouterStatePatchToTree(
flightSegmentPath.slice(2),
Expand Down

0 comments on commit 678b487

Please sign in to comment.