patch_deepCopy method
Given an array of patches, return another array that is identical.
patches
is a List of Patch objects.
Returns a List of Patch objects.
Implementation
List<Patch> patch_deepCopy(List<Patch> patches) {
final patchesCopy = <Patch>[];
for (final aPatch in patches) {
final patchCopy = Patch();
for (final aDiff in aPatch.diffs) {
patchCopy.diffs.add(Diff(aDiff.operation, aDiff.text));
}
patchCopy.start1 = aPatch.start1;
patchCopy.start2 = aPatch.start2;
patchCopy.length1 = aPatch.length1;
patchCopy.length2 = aPatch.length2;
patchesCopy.add(patchCopy);
}
return patchesCopy;
}