ObjFW  Check-in [523bf78c46]

Overview
Comment:Small optimization for ASCII strings in -[stringByXMLUnescaping].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 523bf78c4654bd0ffe3a0f16688a911ad55167c5735dc19b5f0cec387ecd3e0d
User & Date: js on 2010-09-20 11:14:34
Other Links: manifest | tags
Context
2010-09-20
11:26
Better API for the writte buffer of streams.
Can now be disabled without flushing and then be flushed later.
check-in: c3c2bcca46 user: js tags: trunk
11:14
Small optimization for ASCII strings in -[stringByXMLUnescaping]. check-in: 523bf78c46 user: js tags: trunk
01:18
Prefix utils in if we're doing a crosscompile. check-in: 85e9a7540c user: js tags: trunk
Changes

Modified src/OFString+XMLUnescaping.m from [be2a2ed79d] to [5bd62589b9].

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	size_t i, last;
	BOOL in_entity;
	OFMutableString *ret;

	last = 0;
	in_entity = NO;
	ret = [OFMutableString string];

	switch (of_string_check_utf8(string, length)) {
	case 1:
		((OFString*)ret)->isUTF8 = YES;
		break;
	case -1:
		@throw [OFInvalidEncodingException newWithClass: isa];
	}

	for (i = 0; i < length; i++) {
		if (!in_entity && string[i] == '&') {
			[ret appendCStringWithoutUTF8Checking: string + last
						       length: i - last];

			last = i + 1;







<
<
<
|
<
<
<
<







80
81
82
83
84
85
86



87




88
89
90
91
92
93
94
	size_t i, last;
	BOOL in_entity;
	OFMutableString *ret;

	last = 0;
	in_entity = NO;
	ret = [OFMutableString string];



	((OFString*)ret)->isUTF8 = [self isUTF8];





	for (i = 0; i < length; i++) {
		if (!in_entity && string[i] == '&') {
			[ret appendCStringWithoutUTF8Checking: string + last
						       length: i - last];

			last = i + 1;