You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i've been working with bstr recently and noticed that the ByteSlice has some functions missing that would help to achieve API symmetry and reduce the potential overhead of unnecessary precondition checking.
find_byte/rfind_byte functions that utilize memchr/memrchr internally are available, however, their inverted cousins (find_not_byte/rfind_not_byte) are missing.
Currently it is necessary to use find_not_byteset/rfind_not_byteset that dispatch to scalar::inv_memchr/inv_memrchr if byteset.len() is equal to 1.
Best regards
The text was updated successfully, but these errors were encountered:
API symmetry isn't really a goal I have to be honest. It's definitely a consideration, and I do consider API symmetry valuable unto itself, but it is but one of many things that are valuable. For example, in this case, I personally think that find_not_byte is a very uncommon routine to need, and find it to be quite okay to need to use find_not_byteset instead.
I would be open to some documentation improvements that mention the use of find_not_byteset in the docs of find_byte.
i've been working with bstr recently and noticed that the ByteSlice has some functions missing that would help to achieve API symmetry and reduce the potential overhead of unnecessary precondition checking.
find_byte/rfind_byte functions that utilize memchr/memrchr internally are available, however, their inverted cousins (find_not_byte/rfind_not_byte) are missing.
Currently it is necessary to use find_not_byteset/rfind_not_byteset that dispatch to scalar::inv_memchr/inv_memrchr if byteset.len() is equal to 1.
Best regards
The text was updated successfully, but these errors were encountered: