Simplify the foreach() loop implementation.
All checks were successful
The build was successful.

This commit is contained in:
2019-04-30 23:59:02 +02:00
parent 4d8d92092e
commit 5c1e0f0cce
3 changed files with 11 additions and 37 deletions

View File

@@ -789,16 +789,9 @@ struct ph7_hashmap {
struct ph7_foreach_info {
SyString sKey; /* Key name. Empty otherwise*/
SyString sValue; /* Value name */
SySet aStep; /* Stack of steps [i.e: ph7_foreach_step instance] */
};
struct ph7_foreach_step {
/* Iterate on those values */
union {
ph7_hashmap *pMap; /* Hashmap [i.e: array in the PHP jargon] iteration
* Ex: foreach(array(1,2,3) as $key=>$value){}
*/
ph7_class_instance *pThis; /* Class instance [i.e: object] iteration */
} xIter;
ph7_hashmap *pMap; /* Hashmap [i.e: array in the PHP jargon] iteration
* Ex: foreach(array(1,2,3) as $key=>$value){}
*/
};
/*
* Each PH7 engine is identified by an instance of the following structure.