Skip to content

Commit b0fbeae

Browse files
committed
Union method should snapshot the codepoint collection.
Given the repeated usage of Codepoint\Collection::has() we need to guarantee traversability.
1 parent b589983 commit b0fbeae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/UCD/Unicode/Character/Repository/Capability/CodepointSearchByIteration.php

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public function getByCodepoints(Codepoint\Collection $codepoints)
4242
*/
4343
protected function unionAgainstCodepoints(Codepoint\Collection $codepoints)
4444
{
45+
$codepoints = $codepoints->takeSnapshot();
46+
4547
foreach ($this->getAll() as $character) {
4648
if ($codepoints->has($character->getCodepoint())) {
4749
yield $character;

0 commit comments

Comments
 (0)