59 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
Dima Kudosh f035fb8e65 Merge pull request #5 from nmlgc/master
Make SequenceMatcher generic over all slice types
2018-07-22 15:36:05 +03: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 de82e46021 Apply all Clippy lints that don't break the API 2018-07-02 20:09:51 +02:00
nmlgc 282c139cc0 Remove generic types from Differ
The entire implementation pretty much only makes sense for string
slices, and that was all the original code supported anyway.
2018-07-01 18:41:22 +02:00
nmlgc e2bbf92e4c chain_second_seq(): Filter out junk and popular elements in a more idiomatic way 2018-06-30 12:40:50 +02:00
nmlgc 63e214364a Remove second_sequence_popular from the SequenceMatcher struct.
It's never read from.
2018-06-29 11:58:31 +02:00
nmlgc e36a1d4645 Fix mutability warnings 2018-06-28 13:19:50 +02:00
nmlgc a053cc079a Run cargo fmt 2018-06-15 11:54:48 +02:00
Dima Kudosh 1805d9a548 Merge branch 'master' of https://github.com/DimaKudosh/difflib 2018-03-24 18:02:05 +03:00
Dima Kudosh 41c8240cb7 Replaced Vec with HashSet for second_sequence_popular 2018-03-24 18:01:27 +03:00
Dima Kudosh e9ee39e40d Merge pull request #3 from mark-summerfield/master
Made example compile
2018-02-16 20:20:36 +03:00
Mark Summerfield 07dd9507e5 Made example compile
Elimitated two errors of type `error[E0061]: this function takes 7 parameters but 8 parameters were supplied`
2018-02-04 09:15:02 +00:00
Dima Kudosh 8748d65b8c Update version, changed license 2017-09-09 20:00:38 +03:00
Dima Kudosh 428ab41a85 Merge pull request #2 from mitsuhiko/bugfix/saturating-add
Fixed a bug with subtraction in the opcode code
2017-07-16 14:17:52 +03:00
Armin Ronacher 76384c2568 Fixed a bug with subtraction in the opcode code 2017-07-12 20:14:01 +02:00
Dima Kudosh e0726b8cb6 Update README.md 2017-02-26 19:47:07 +03:00
Dima Kudosh ad9ce725df Merge branch 'master' of https://github.com/DimaKudosh/difflib 2017-02-26 19:33:43 +03:00
Dima Kudosh 07de887127 Reformat code with rustfmt 2017-02-26 19:32:22 +03:00
Dima Kudosh 5211f2cefc Update .travis.yml 2017-02-26 18:40:45 +03:00
Dima Kudosh 2826c989b8 Update .travis.yml 2017-02-26 18:36:06 +03:00
Dima Kudosh 4d590da030 Update .travis.yml 2017-02-26 18:32:17 +03:00
Dima Kudosh 49fbbb0b63 Update .travis.yml 2017-02-26 18:24:08 +03:00
Dima Kudosh e2db972e41 Update .travis.yml 2017-02-26 18:11:50 +03:00
Dima Kudosh ff85a377a1 Update .travis.yml 2017-02-26 18:02:28 +03:00
Dima Kudosh 0c85c87f11 Update .travis.yml 2017-02-26 17:55:47 +03:00
Dima Kudosh 7fc731ab99 update version 2017-01-16 15:58:25 +03:00
Dima Kudosh cc895463c3 Merge pull request #1 from binarycrusader/binarycrusader-patch-1
support String in sequencematcher.rs
2017-01-16 15:46:01 +03:00
Shawn Walker-Salas 5975412d97 Update sequencematcher.rs 2017-01-11 22:32:21 -08:00
Dima Kudosh 5ecc5d633e Update README.md 2016-07-02 21:13:13 +03:00
Dima Kudosh 2a8572dee3 Create .travis.yml 2016-07-02 21:12:02 +03:00
Dima Kudosh 900da83d59 Rename test.rs to tests.rs 2016-07-02 21:10:52 +03:00
Dima Kudosh 063536e703 Update Cargo.toml 2016-03-01 23:12:48 +03:00
Dima Kudosh 16fc483ea1 Remove warnings 2016-03-01 15:00:07 +03:00
Dima Kudosh ef70f2450e Remove lineterm in contextt_diff and unified_diff 2016-03-01 14:51:36 +03:00
Dima Kudosh 963a917bf7 Remove Sequence trait implementation for array 2016-02-29 14:39:28 +03:00
Dima Kudosh 0035a1b816 Change spaces to tab 2016-02-29 14:05:31 +03:00
Dima Kudosh 37b2c3697e Create UNLICENSE 2016-02-29 13:35:02 +03:00
Dima Kudosh 7e7e22d26d Create README.md 2016-02-29 13:33:40 +03:00
Dima Kudosh 208671babd Add example 2016-02-28 22:33:35 +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
Dima Kudosh 792515fb0d Change algorithm for finding largest common sequence, change SequenceMatcher to generic 2016-02-27 21:55:43 +03:00
Dima Kudosh 43a88b17b2 Add function to get grouping opcodes for sequence matcher struct 2016-02-18 13:59:47 +03:00