ObjFW  Check-in [6c93ca551a]

Overview
Comment:Better values for OFMutableDictionary resizing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6c93ca551abb16e34b53ba69fede122a86dbe366c69f0531ef26c855ad8e22bb
User & Date: js on 2010-03-19 22:05:22
Other Links: manifest | tags
Context
2010-04-01
20:57
Improve method replacing when using the Apple runtime. check-in: 54e971a3a6 user: js tags: trunk
2010-03-25
15:40
Add ${LIB_CPPFLAGS}. check-in: 865dd4849f user: js tags: trunk
2010-03-19
22:05
Better values for OFMutableDictionary resizing. check-in: 6c93ca551a user: js tags: trunk
00:53
Better out of range checking in OFMutableDictionary. check-in: 12689ed614 user: js tags: trunk
Changes

Modified src/OFMutableDictionary.m from [6f0115135e] to [d4b94495f4].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	size_t newsize;
	struct of_dictionary_bucket *newdata;
	uint32_t i;

	if (count > SIZE_MAX / 4)
		@throw [OFOutOfRangeException newWithClass: isa];

	if (fill > 3)
		newsize = *size << 1;
	else if (fill < 1)
		newsize = *size >> 1;
	else
		return;

	if (newsize == 0)
		@throw [OFOutOfRangeException newWithClass: isa];








|

|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	size_t newsize;
	struct of_dictionary_bucket *newdata;
	uint32_t i;

	if (count > SIZE_MAX / 4)
		@throw [OFOutOfRangeException newWithClass: isa];

	if (fill >= 3)
		newsize = *size << 1;
	else if (fill <= 1)
		newsize = *size >> 1;
	else
		return;

	if (newsize == 0)
		@throw [OFOutOfRangeException newWithClass: isa];