Skip to content
Snippets Groups Projects
Commit 99255182 authored by Per Hedbor's avatar Per Hedbor
Browse files

Added min- and max- range-indicators to strings.

Also added flags indicating if a string is lowercase or uppercase.

The min/max is only calculated on demand to avoid any slowdowns.

This makes upper_case/lower_case(X), where X is an already lowercased
string very fast ('search' also utilize the ranges when available, so
search(string,"\0") is very fast if there are no null characters in
the string).

It also speeds up the %s format for get_all_args (at least the second
time a certain string is used) since the function checking for null
characters can now use the fields.

Currently most string operations simply reset the string to unchecked,
as an optimization they could copy the ranges/flag as appropriate.

The + operator already does keep track of the flags and ranges.

For wide-strings the min/max value is somewhat less correct, since
it's saved in a single byte. But '0' still works (you get string(0..X)
for strings with 0, and string(1..X) for strings without 0 but with
any other character from the first 255).
parent 3c01c233
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment