summaryrefslogtreecommitdiff
path: root/src/diff.hh
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2023-12-26Take eq predicate by reference in for_each_diffMaxime Coste
2020-03-20Remove posB from information given by the diff algorithmMaxime Coste
posB is always the sum of previous add len and previous keep len, so very easy to keep track of.
2020-03-20Remove uses of reverse_iterator in diff implementationMaxime Coste
2020-02-18Make diff implementation able to work on different iterator typesMaxime Coste
2019-12-01src: Fix the build on MacFrank LENORMAND
When compiled on Mac with `clang`, the following error occurs at compile-time: ``` ./diff.hh:56:28: error: no member named 'min' in namespace 'std' const int max_D = std::min((M + N + 1) / 2 + 1, cost_limit); ~~~~~^ ```
2019-11-30Refactor diff to make allocating a diff vector optionalMaxime Coste
The diff interface now goes through a for_each_diff function that uses a callback for each found diff.
2018-02-09diff: try to improve code readabilityMaxime Coste
2017-09-07Small code simplificationsMaxime Coste
2017-07-23Limit diff algorithm complexityMaxime Coste
Return a non-optimal, but valid, diff when we detect too many iterations Fixes #1509
2017-07-20More cleanups in diff codeMaxime Coste
2017-07-18Use the provided equal functor for prefix/suffix detection in diffMaxime Coste
We were wrongly using the `==` operator.
2017-07-18More refactoring of the diff code in order to make it cleanerMaxime Coste
2017-07-18Change diff Implementation to use end indices instead of lengthMaxime Coste
Having absolute begin and relative lenght was a bit strange to work with. Rename middle_snake to snake.
2017-07-17Slight style changeMaxime Coste
2017-07-17Refactor find_diff_rec and detect kept prefix/suffixes earlyMaxime Coste
Certain cases, like diffing an empty buffer with a big buffer, were very slow, now this should get better as we will directly detect the matching eol at the end of both buffers, end then immediatly detect we need to add the rest of the big buffer. We still are too slow on some general diff when there is a lot of differences.
2017-07-17Remove MirroredArray for diff implementationMaxime Coste
We can index native arrays negatively, so just setup V1 and V2 to point in the middle of the work arrays and remove the need for creating MirroredArray.
2017-07-15Small code cleanup in diff implementationMaxime Coste
2017-01-29Remove unused Diff::posA fieldMaxime Coste
2015-11-19Remove trailing whitespacesMichael Vetter
2015-07-13Formatting tweakMaxime Coste
2015-05-19Add headers guard to diff.hh along with a comment about the algorithmMaxime Coste
2015-05-18Fix bug in diff implementations (missing snake after d=1 change) and refactorMaxime Coste
2015-05-17Only initialize element 1 in mirrored arrays.Maxime Coste
2015-05-15Another bug fix in diff implementationMaxime Coste
2015-05-14always_inline a few methodsMaxime Coste
2015-05-14Fix bugs in diff implementationMaxime Coste
2015-05-13Fix diff implementation and change the Diff struct formatMaxime Coste
2015-05-12Add initial diff implementation based Eugene W. Myers' algorithmMaxime Coste