aboutsummaryrefslogtreecommitdiffstats
path: root/Iterator
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2013-05-13 18:55:06 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2013-05-13 18:55:06 +0200
commitc018171e085f95e15b346460d243c7447fa1af17 (patch)
tree1d53c31ae51ff9917011cd2e335d44ed62fccd93 /Iterator
parent9bfb4587383ba5f40fe973219b5263e52aacefe5 (diff)
downloadPraspel-c018171e085f95e15b346460d243c7447fa1af17.zip
Praspel-c018171e085f95e15b346460d243c7447fa1af17.tar.gz
Praspel-c018171e085f95e15b346460d243c7447fa1af17.tar.bz2
Avoid an infinite loop when there is no variable.
Diffstat (limited to 'Iterator')
-rw-r--r--Iterator/Coverage/Domain.php7
-rw-r--r--Iterator/Coverage/Structural.php2
2 files changed, 5 insertions, 4 deletions
diff --git a/Iterator/Coverage/Domain.php b/Iterator/Coverage/Domain.php
index 06ddf53..e3c93c7 100644
--- a/Iterator/Coverage/Domain.php
+++ b/Iterator/Coverage/Domain.php
@@ -92,7 +92,7 @@ class Domain implements \Hoa\Iterator {
*
* @var \Hoa\Praspel\Iterator\Coverage\Domain bool
*/
- protected $_end = false;
+ protected $_break = true;
@@ -108,7 +108,8 @@ class Domain implements \Hoa\Iterator {
foreach($variables as $variable)
$this->_variables[] = $variable->getDomains()->getIterator();
- $this->_max = count($this->_variables) - 1;
+ $this->_max = count($this->_variables) - 1;
+ $this->_break = empty($this->_variables);
return;
}
@@ -192,7 +193,7 @@ class Domain implements \Hoa\Iterator {
*/
public function rewind ( ) {
- $this->_break = false;
+ $this->_break = empty($this->_variables);
$this->_key = 0;
foreach($this->_variables as $variable)
diff --git a/Iterator/Coverage/Structural.php b/Iterator/Coverage/Structural.php
index cf2fea2..7888a34 100644
--- a/Iterator/Coverage/Structural.php
+++ b/Iterator/Coverage/Structural.php
@@ -401,7 +401,7 @@ class Structural implements \Hoa\Iterator\Recursive {
$pre = array();
$post = array();
$iterator = new \Hoa\Iterator\Multiple(
- \Hoa\Iterator\Multiple::MIT_NEED_ALL
+ \Hoa\Iterator\Multiple::MIT_NEED_ANY
| \Hoa\Iterator\Multiple::MIT_KEYS_ASSOC
);