rollinghash icon indicating copy to clipboard operation
rollinghash copied to clipboard

Refactoring + optimization

Open greatroar opened this issue 4 years ago • 0 comments

Here's some refactoring of the common code for dealing with rolling windows.

The first patch factors out the WriteWindow methods to a function in an internal package. The WriteWindow methods are now so small that they get inlined, so callers still do a single function call (not counting the Write calls).

The second factors out the re-arranging, while changing the algorithm to operate in-place (no allocation).

greatroar avatar Jul 30 '20 11:07 greatroar