Checking strings against set of characters in net_FindCharNotInSet and net_FindCharInSet is highly inefficient. This is probably not a real bottleneck, because it isn't called too often. Checking against some bitmap would be probably ideal but it would be hard to read. What about to introduce ranges? Somehing like:
Checking strings against set of characters in net_FindCharNot InSet and net_FindCharInSet is highly inefficient. This is probably not a real bottleneck, because it isn't called too often. Checking against some bitmap would be probably ideal but it would be hard to read. What about to introduce ranges? Somehing like:
char * InRangesAndSet( const char *iter, const char *stop, const char *ranges, const char *set);
net_FindCharNot
Checking would be done against ranges first and then against set.
Set "$+-.0123456789 _abcdefghijklmn opqrstuvwxyzABC DEFGHIJKLMNOPQR STUVWXYZ" can be replaced by ranges "az09-.AZ" and set "$+_" and it should be faster.
Any opinions?