You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Diff returns a string containing a line-by-line unified diff of the linewise
// changes required to make A into B. Each line is prefixed with '+', '-', or
// ' ' to indicate if it should be added, removed, or is correct respectively.
funcDiff(A, Bstring) string {
It seems if one input of Diff is empty, then the algorithm uses O(N^2) space, where N is the size of the other input.
The result is I see out of memory error if I diff an empty chunk with a non-empty chunk.
It'll be a good improvement if we can just do an empty check before calling the Diff algorithm. And generating diffstring in such case should not be very hard.
The text was updated successfully, but these errors were encountered:
godebug/diff/diff.go
Lines 37 to 40 in e693023
It seems if one input of Diff is empty, then the algorithm uses O(N^2) space, where N is the size of the other input.
The result is I see out of memory error if I diff an empty chunk with a non-empty chunk.
It'll be a good improvement if we can just do an empty check before calling the Diff algorithm. And generating diffstring in such case should not be very hard.
The text was updated successfully, but these errors were encountered: