Commit Graph

15 Commits

Author SHA1 Message Date
David Stern 114177e7d8 Improve performance of difflib. (#1)
* Improve performance of difflib, primarily by avoiding heap allocations.

* Add doc comment to real_quick_ratio.
2024-06-03 14:11:35 -04:00
nmlgc 31ea2a244a Test SequenceMatcher with integer slices 2018-07-06 15:14:17 +02:00
nmlgc 06afc1879b Implicitly convert &str to [u8] for compatibility with existing usage code
Thanks to stephaneyfx from the #rust IRC channel for showing me that
this needs separate type parameters on the functions in order to
compile.

The only API change that can't be helped are the `line_junk` and
`char_junk` function pointers in the Differ struct, which now take
`&&str` and `&char` parameters, respectively. This is probably for the
better, since `char_junk` now operates on Unicode scalar values rather
than the single UTF-8 bytes disguised as `&str` that were previously
retrieved via the unsafe `slice_unchecked()` function.
2018-07-05 21:46:43 +02:00
nmlgc 6fd59b0c08 Make SequenceMatcher generic over all slice types 2018-07-03 20:28:11 +02:00
nmlgc a053cc079a Run cargo fmt 2018-06-15 11:54:48 +02:00
Dima Kudosh 07de887127 Reformat code with rustfmt 2017-02-26 19:32:22 +03:00
Dima Kudosh 900da83d59 Rename test.rs to tests.rs 2016-07-02 21:10:52 +03:00
Dima Kudosh ef70f2450e Remove lineterm in contextt_diff and unified_diff 2016-03-01 14:51:36 +03:00
Dima Kudosh 0035a1b816 Change spaces to tab 2016-02-29 14:05:31 +03:00
Dima Kudosh a99af75280 Add ability to specify user-defined functions for matcher 2016-02-28 21:35:03 +03:00
Dima Kudosh b2e0c729ff Add ability to restore sequence after differ 2016-02-28 19:47:48 +03:00
Dima Kudosh 3781894ffc Add context diff and tests for it 2016-02-28 19:14:11 +03:00
Dima Kudosh 0fa2c80be0 Add unified diff and tests for it 2016-02-28 18:24:03 +03:00
Dima Kudosh 2d309c0ba4 Add new tests, fix bugs with Differ 2016-02-28 17:38:44 +03:00
Dima Kudosh 53553047df Wrote some tests 2016-02-27 21:56:16 +03:00