@@ 35-44 (lines=10) @@ | ||
32 | * |
|
33 | * @param array|\Traversable|int|null $values |
|
34 | */ |
|
35 | public function __construct($values = null) |
|
36 | { |
|
37 | $this->internal = new Map(); |
|
38 | ||
39 | if (is_array($values) || $values instanceof Traversable) { |
|
40 | $this->addAll($values); |
|
41 | } elseif (is_integer($values)) { |
|
42 | $this->allocate($values); |
|
43 | } |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * Adds zero or more values to the set. |
@@ 34-44 (lines=11) @@ | ||
31 | * |
|
32 | * @param array|\Traversable|int|null $values |
|
33 | */ |
|
34 | public function __construct($values = null) |
|
35 | { |
|
36 | $this->reset(); |
|
37 | ||
38 | if (is_array($values) || $values instanceof Traversable) { |
|
39 | $this->putAll($values); |
|
40 | ||
41 | } else if (is_integer($values)) { |
|
42 | $this->allocate($values); |
|
43 | } |
|
44 | } |
|
45 | ||
46 | private function reset() |
|
47 | { |