Fix bd-ng56: add raw string equality short-circuit before jsonEquals
Optimization to avoid JSON unmarshalling when strings match exactly (common case). Simple 1-line change instead of complex streaming rewrite for P3 issue.
This commit is contained in:
@@ -323,8 +323,8 @@ func computeAcceptedDeletions(basePath, leftPath, mergedPath string) ([]string,
|
||||
for id, baseLine := range baseIndex {
|
||||
// Issue in base but not in merged
|
||||
if !mergedIDs[id] {
|
||||
// Check if unchanged locally using semantic JSON comparison
|
||||
if leftLine, existsInLeft := leftIndex[id]; existsInLeft && jsonEquals(leftLine, baseLine) {
|
||||
// Check if unchanged locally - try raw equality first, then semantic JSON comparison
|
||||
if leftLine, existsInLeft := leftIndex[id]; existsInLeft && (leftLine == baseLine || jsonEquals(leftLine, baseLine)) {
|
||||
deletions = append(deletions, id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user