aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/references.hh
AgeCommit message (Collapse)Author
2024-07-11libutil: rewrite RewritingSink as sourceeldritch horrors
the rewriting sink was just broken. when given a rewrite set that contained a key that is also a proper infix of another key it was possible to produce an incorrectly rewritten result if the writer used the wrong block size. fixing this duplicates rewriteStrings, to avoid this we'll rewrite rewriteStrings to use RewritingSource in a new mode that'll allow rewrites we had previously forbidden. Change-Id: I57fa0a9a994e654e11d07172b8e31d15f0b7e8c0
2024-07-06libutil: remove RewritingSink match/size trackingeldritch horrors
size tracking can be done with a LengthSink and a tee. match tracking was defeated by never having done any match tracking, all users would see the same (empty) set of matches at all times. match tracking with bytes offsets alone would not be sufficient in the general case, only because computeHashModulo uses a single rewrite could it have worked. Change-Id: Idb214b5222e0ea24f450f5505712a342b63d7570
2024-07-06libutil: turn HashModuloSink into a free functioneldritch horrors
Change-Id: I5878007502fa68c2816a0f4c61f7d0e60bdde702
2023-06-15Don't assume the type of string::size_typeThéophane Hufschmitt
The code accidentally conflated `std::string::size_type` and `long unsigned int`. This was fine on 64bits machines where they are apparently the same in practice, but not on 32bits. Fix that by using `std::string::size_type` everywhere.
2023-05-24Make `RewritingSink` accept a map of rewritesThéophane Hufschmitt
Giving it the same semantics as `rewriteStrings`. Also add some tests for it