> Hi, > SBuf supplies a few find() variants which could help which are not constant > time but rely on lower-level primitives and related optimizations. My > suggestion is to have CharacterSet be a SBuf and rely on them, at least for > now. In any case having them be a SBuf promotes better interface decoupling > and abstraction.
Oh, one more argument for having the low-level matching primitives in SBuf: it's a pet peeve of mine to use some form of compact tries and/or FSM to do single-pass low-level string matching in SBuf, possibly by lifting code from GNU grep (it's very efficient but complex). Redoing find_first_of() and startsWith() here would duplicate code and undermine that possibility and qualifies as premature optimisation IMO :) Kinkie