Skip to content

Commit

Permalink
Refractored: hollow/api/client/HollowUpdatePlanner.java, Renamed delt…
Browse files Browse the repository at this point in the history
…aPlan to updatePlan to increase code readability
  • Loading branch information
UTKARSH SHAH committed Apr 4, 2023
1 parent c843e8b commit 2a6acd2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ public HollowUpdatePlan planUpdate(long currentVersion, long desiredVersion, boo
if (currentVersion == HollowConstants.VERSION_NONE)
return snapshotPlan(desiredVersion);

HollowUpdatePlan deltaPlan = deltaPlan(currentVersion, desiredVersion, doubleSnapshotConfig.maxDeltasBeforeDoubleSnapshot());
HollowUpdatePlan updatePlan = deltaPlan(currentVersion, desiredVersion, doubleSnapshotConfig.maxDeltasBeforeDoubleSnapshot());

long deltaDestinationVersion = deltaPlan.destinationVersion(currentVersion);
long deltaDestinationVersion = updatePlan.destinationVersion(currentVersion);

long snapshotDestinationVersion = snapshotPlan(desiredVersion).destinationVersion(currentVersion);

if(deltaDestinationVersion == desiredVersion){
return deltaPlan;
return updatePlan;
}

if(allowSnapshot && snapshotDestinationVersion == desiredVersion){
Expand All @@ -93,7 +93,7 @@ public HollowUpdatePlan planUpdate(long currentVersion, long desiredVersion, boo
return snapshotPlan(desiredVersion);
}

return deltaPlan;
return updatePlan;
}

/**
Expand Down

0 comments on commit 2a6acd2

Please sign in to comment.