* Find the differences between two texts. * @param text1 Old string to be diffed. * @param text2 New string to be diffed. * @param checklines Speedup flag. If false, then don't run a * line-level diff first to identify the changed areas. * If true, then run a faster slightly less optimal diff. * Most of the time checklines is wanted, so default to true. * @return
| 278 | * @return Linked List of Diff objects. |
| 279 | */ |
| 280 | Diffs diff_main(const string_t &text1, const string_t &text2, bool checklines = true) const { |
| 281 | // Set a deadline by which time the diff must be complete. |
| 282 | clock_t deadline; |
| 283 | if (Diff_Timeout <= 0) { |
| 284 | deadline = std::numeric_limits<clock_t>::max(); |
| 285 | } else { |
| 286 | deadline = clock() + (clock_t)(Diff_Timeout * CLOCKS_PER_SEC); |
| 287 | } |
| 288 | Diffs diffs; |
| 289 | diff_main(text1, text2, checklines, deadline, diffs); |
| 290 | return diffs; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Find the differences between two texts. Simplifies the problem by |