3 Nov
2015
3 Nov
'15
9:28 p.m.
I was looking in boost/algorithm/string/predicate.hpp and noticed that that
the predicates *starts_with, *ends_with, *contains and *equals don't
optimize for random access iterators.
While I haven't done any benchmarks yet, it seems like it would be faster
for random access iterators to do an O(1) length check at the beginning and
then while looping only check one iterator against its end instead of two.
Thoughts?
Nevin :-)
--
Nevin ":-)" Liber