Skip to main content

Module setdiff

Module setdiff 

Source
Expand description

The lines of one text that occur nowhere in another, whatever their order (a set difference by line), for texts of any size. The other text’s line hashes are held in memory up to a budget; past it both sides are split by hash into partition files on disk and compared one partition at a time.

Lines compare without their line breaks (CRLF and LF lines are the same), as UTF-8 whatever the encodings, and after the DiffOptions normalisation (white space, case, timestamps, a mask). A line counts as present when it occurs at least once (sets, not counts).

Structs§

Counts
How many of the text’s lines are only in it and how many also in the other.

Constants§

BUDGET
Distinct line hashes of the other text kept in memory (8 bytes each, plus the table).

Functions§

only_in
Calls on_line with the offset of each line of a that is not in b, in order (return false to stop). budget is the number of distinct line hashes of b held in memory before spilling to disk. None when cancelled.
write_line_at
Writes the line at off (with its line break) from buf.