Overview
Comment: | More OFXMLParser optimizations.
With the last few commits, OFXMLParser is now twice as fast as before. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8953d826b49f07dcc18426245b93c434 |
User & Date: | js on 2011-10-11 22:21:16 |
Other Links: | manifest | tags |
Context
2011-10-11
| ||
22:30 | Make it possible to close an OFProcess for writing. check-in: 88a34646a4 user: js tags: trunk | |
22:21 | More OFXMLParser optimizations. check-in: 8953d826b4 user: js tags: trunk | |
22:13 | Small optimization in OFXMLParser. check-in: 8523d20555 user: js tags: trunk | |
Changes
Modified src/OFXMLParser.m from [7b02ea3041] to [e2b24f34eb].
︙ | ︙ | |||
60 61 62 63 64 65 66 | } } static OFString* transform_string(OFDataArray *cache, size_t cut, BOOL unescape, OFObject <OFStringXMLUnescapingDelegate> *delegate) { | > > > | > | | > > > > > | > | > > > > > | | > | | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | } } static OFString* transform_string(OFDataArray *cache, size_t cut, BOOL unescape, OFObject <OFStringXMLUnescapingDelegate> *delegate) { char *cArray; size_t i, length; BOOL hasEntities = NO; OFMutableString *ret; cArray = [cache cArray]; length = [cache count] - cut; for (i = 0; i < length; i++) { if (cArray[i] == '\r') { if (i + 1 < length && cArray[i + 1] == '\n') { [cache removeItemAtIndex: i]; cArray = [cache cArray]; i--; length--; } else cArray[i] = '\n'; } else if (cArray[i] == '&') hasEntities = YES; } ret = [OFMutableString stringWithUTF8String: cArray length: length]; if (unescape && hasEntities) return [ret stringByXMLUnescapingWithDelegate: delegate]; [ret makeImmutable]; return ret; } |
︙ | ︙ |