Refactor Terminator to reduce complexity
Use iterators and a helper function to implement Terminator in a clearer way (high cyclomatic complexity in previous implementation). Use an enum to detect error types to deal with them in another scope without requiring an artificial block, as well as to avoid the overhead of dealing with bitflags when not needed. Use native iterators whenever possible, and create a custom one to keep track of the last two characters found.
Loading
Please register or sign in to comment