Gitweb links:
...log
http://git.netsurf-browser.org/libdom.git/shortlog/4ef9aeab25b67fa27e9514...
...commit
http://git.netsurf-browser.org/libdom.git/commit/4ef9aeab25b67fa27e951473...
...tree
http://git.netsurf-browser.org/libdom.git/tree/4ef9aeab25b67fa27e951473c7...
The branch, master has been updated
via 4ef9aeab25b67fa27e951473c78f33a600503ee4 (commit)
via a37713d9b0d49e9996b6eba9789e6f4ace88cb85 (commit)
from 737cb995c1b2bf144ee5087a011418b1f9b8aa69 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libdom.git/commit/?id=4ef9aeab25b67fa27e95...
commit 4ef9aeab25b67fa27e951473c78f33a600503ee4
Merge: 737cb99 a37713d
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Merge branch 'tlsa/faster-strings'
-----------------------------------------------------------------------
Summary of changes:
src/core/string.c | 40 +++++++++-------------------------------
1 file changed, 9 insertions(+), 31 deletions(-)
diff --git a/src/core/string.c b/src/core/string.c
index d4c5cdf..9af2e74 100644
--- a/src/core/string.c
+++ b/src/core/string.c
@@ -935,8 +935,7 @@ dom_string_toupper(dom_string *source, bool ascii_only, dom_string
**upper)
const uint8_t *orig_s = (const uint8_t *) dom_string_data(source);
const size_t nbytes = dom_string_byte_length(source);
uint8_t *copy_s;
- size_t index = 0, clen;
- parserutils_error err;
+ size_t index = 0;
dom_exception exc;
if (ascii_only == false)
@@ -948,21 +947,11 @@ dom_string_toupper(dom_string *source, bool ascii_only, dom_string
**upper)
memcpy(copy_s, orig_s, nbytes);
while (index < nbytes) {
- err = parserutils_charset_utf8_char_byte_length(orig_s + index,
- &clen);
- if (err != PARSERUTILS_OK) {
- free(copy_s);
- /** \todo Find a better exception */
- return DOM_NO_MEM_ERR;
+ if (orig_s[index] >= 'a' && orig_s[index] <= 'z') {
+ copy_s[index] -= 'a' - 'A';
}
- if (clen == 1) {
- if (orig_s[index] >= 'a' &&
- orig_s[index] <= 'z')
- copy_s[index] -= 'a' - 'A';
- }
-
- index += clen;
+ index++;
}
if (((dom_string_internal*)source)->type == DOM_STRING_CDATA) {
@@ -992,8 +981,7 @@ dom_string_tolower(dom_string *source, bool ascii_only, dom_string
**lower)
const uint8_t *orig_s = (const uint8_t *) dom_string_data(source);
const size_t nbytes = dom_string_byte_length(source);
uint8_t *copy_s;
- size_t index = 0, clen;
- parserutils_error err;
+ size_t index = 0;
dom_exception exc;
if (ascii_only == false)
@@ -1005,21 +993,11 @@ dom_string_tolower(dom_string *source, bool ascii_only, dom_string
**lower)
memcpy(copy_s, orig_s, nbytes);
while (index < nbytes) {
- err = parserutils_charset_utf8_char_byte_length(orig_s + index,
- &clen);
- if (err != PARSERUTILS_OK) {
- free(copy_s);
- /** \todo Find a better exception */
- return DOM_NO_MEM_ERR;
- }
-
- if (clen == 1) {
- if (orig_s[index] >= 'A' &&
- orig_s[index] <= 'Z')
- copy_s[index] += 'a' - 'A';
+ if (orig_s[index] >= 'A' && orig_s[index] <= 'Z') {
+ copy_s[index] += 'a' - 'A';
}
-
- index += clen;
+
+ index++;
}
if (((dom_string_internal*)source)->type == DOM_STRING_CDATA) {
--
Document Object Model library