ObjFW  Diff

Differences From Artifact [589715e608]:

To Artifact [2e56b1156a]:


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
}

- (void*)data
{
	return data;
}

- (void*)item: (size_t)index
{
	if (index >= count)
		@throw [OFOutOfRangeException newWithClass: isa];

	return data + index * itemsize;
}








|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
}

- (void*)data
{
	return data;
}

- (void*)itemAtIndex: (size_t)index
{
	if (index >= count)
		@throw [OFOutOfRangeException newWithClass: isa];

	return data + index * itemsize;
}

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
	if ([obj count] == count)
		return memcmp(data, [obj data], count * itemsize);

	if (count > [obj count]) {
		if ((ret = memcmp(data, [obj data], [obj count] * itemsize)))
			return ret;

		return *(char*)[self item: [obj count]];
	} else {
		if ((ret = memcmp(data, [obj data], count * itemsize)))
			return ret;

		return *(char*)[obj item: count] * -1;
	}
}

- (uint32_t)hash
{
	uint32_t hash;
	size_t i;







|




|







155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
	if ([obj count] == count)
		return memcmp(data, [obj data], count * itemsize);

	if (count > [obj count]) {
		if ((ret = memcmp(data, [obj data], [obj count] * itemsize)))
			return ret;

		return *(char*)[self itemAtIndex: [obj count]];
	} else {
		if ((ret = memcmp(data, [obj data], count * itemsize)))
			return ret;

		return *(char*)[obj itemAtIndex: count] * -1;
	}
}

- (uint32_t)hash
{
	uint32_t hash;
	size_t i;