version 1.12, 2009/12/15 11:39:34
|
version 1.13, 2013/05/16 10:12:19
|
|
|
inline void _checkBounds(size_t index, size_t size) | inline void _checkBounds(size_t index, size_t size) |
{ | { |
if (index > size) | if (index > size) |
|
{ |
StringThrowOutOfBounds(); | StringThrowOutOfBounds(); |
} | } |
|
} |
| |
template<class P, class Q> | template<class P, class Q> |
static void _copy(P* p, const Q* q, size_t n) | static void _copy(P* p, const Q* q, size_t n) |
|
|
// Process leading 7-bit ASCII characters (to avoid UTF8 overhead later). | // Process leading 7-bit ASCII characters (to avoid UTF8 overhead later). |
// Use loop-unrolling. | // Use loop-unrolling. |
| |
while (n >=8 && ((q[0]|q[1]|q[2]|q[3]|q[4]|q[5]|q[6]|q[7]) & 0x80) == 0) |
while ( (n >=8) && ((q[0]|q[1]|q[2]|q[3]|q[4]|q[5]|q[6]|q[7]) & 0x80) == 0) |
{ | { |
p[0] = q[0]; | p[0] = q[0]; |
p[1] = q[1]; | p[1] = q[1]; |
|
|
n -= 8; | n -= 8; |
} | } |
| |
while (n >=4 && ((q[0]|q[1]|q[2]|q[3]) & 0x80) == 0) |
while ((n >=4) && ((q[0]|q[1]|q[2]|q[3]) & 0x80) == 0) |
{ | { |
p[0] = q[0]; | p[0] = q[0]; |
p[1] = q[1]; | p[1] = q[1]; |