ObjFW  Diff

Differences From Artifact [f2d7d60333]:

To Artifact [7caa69a7b0]:


595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621

622
623

624
625
626
627
628
629
630
			block(_buckets[i]->key, _buckets[i]->value, &stop);
	}
}

- (void)replaceValuesUsingBlock: (of_map_table_replace_block_t)block
{
	size_t i;
	bool stop = false;
	unsigned long mutations = _mutations;

	for (i = 0; i < _capacity && !stop; i++) {
		if (_mutations != mutations)
			@throw [OFEnumerationMutationException
			    exceptionWithClass: [self class]
					object: self];

		if (_buckets[i] != NULL && _buckets[i] != &deleted) {
			void *old, *new;

			new = block(_buckets[i]->key, _buckets[i]->value,
			    &stop);
			if (new == NULL)
				@throw [OFInvalidArgumentException
				    exceptionWithClass: [self class]
					      selector: _cmd];

			old = _buckets[i]->value;

			_buckets[i]->value = _valueFunctions.retain(new);
			_valueFunctions.release(old);

		}
	}
}
#endif

- (of_map_table_functions_t)keyFunctions
{







<


|






|

|
<





|
>
|
|
>







595
596
597
598
599
600
601

602
603
604
605
606
607
608
609
610
611
612
613

614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
			block(_buckets[i]->key, _buckets[i]->value, &stop);
	}
}

- (void)replaceValuesUsingBlock: (of_map_table_replace_block_t)block
{
	size_t i;

	unsigned long mutations = _mutations;

	for (i = 0; i < _capacity; i++) {
		if (_mutations != mutations)
			@throw [OFEnumerationMutationException
			    exceptionWithClass: [self class]
					object: self];

		if (_buckets[i] != NULL && _buckets[i] != &deleted) {
			void *new;

			new = block(_buckets[i]->key, _buckets[i]->value);

			if (new == NULL)
				@throw [OFInvalidArgumentException
				    exceptionWithClass: [self class]
					      selector: _cmd];

			if (new != _buckets[i]->value) {
				_valueFunctions.release(_buckets[i]->value);
				_buckets[i]->value =
				    _valueFunctions.retain(new);
			}
		}
	}
}
#endif

- (of_map_table_functions_t)keyFunctions
{