Skip to content

make current_span_len take &mut #690

@yara-blue

Description

@yara-blue

Context:
Many of the fixes regarding span len require keeping track of something within this function. The only way to do that right now is with interior mutability (Cell/RefCell/Mutex etc). As far as I know the only reason current_span_len takes &self is that it simply did not need &mut self.

Advantage:
The code around these fixes will become simpler and more maintainable. Enables optimizations by moving mutations from a conditional space in Iterator::next to current_span_len.

Disadvantage:
Can not call current_span_len while holding a reference to Source somewhere else. Unknown if that is used anywhere.

Help:
Need input whether this change is possible and worth it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions