Skip to content

Commit 03a2749

Browse files
removed Value constructor that wraps around a hash table
1 parent b535eb7 commit 03a2749

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

include/value.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@ class Value
112112
*/
113113
Value(struct _zval_struct *zval, bool ref = false);
114114

115-
/**
116-
* Wrap around a hash table
117-
* @param ht Hashtable to wrap
118-
*/
119-
Value(struct _hashtable *ht);
120-
121115
/**
122116
* Wrap around an object implemented by us
123117
* @param object Object to be wrapped
@@ -445,6 +439,8 @@ class Value
445439
template <typename T>
446440
std::vector<T> vectorValue() const
447441
{
442+
443+
448444
// only works for arrays, other types return an empty vector
449445
if (!isArray()) return std::vector<T>();
450446

src/value.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,6 @@ Value::Value(struct _zval_struct *val, bool ref)
169169
Z_SET_ISREF_P(_val);
170170
}
171171

172-
/**
173-
* Wrap around a hash table
174-
* @param ht Hashtable to wrap
175-
*/
176-
Value::Value(HashTable *ht)
177-
{
178-
// construct a zval
179-
MAKE_STD_ZVAL(_val);
180-
Z_ARRVAL_P(_val) = ht;
181-
Z_TYPE_P(_val) = IS_ARRAY;
182-
183-
// add a reference
184-
// @todo this may be wrong
185-
Z_ADDREF_P(_val);
186-
}
187-
188172
/**
189173
* Wrap around an object
190174
* @param object
@@ -1572,8 +1556,6 @@ ValueIterator Value::begin() const
15721556
if (isObject()) return ValueIterator(Z_OBJ_HT_P(_val)->get_properties(_val), true);
15731557

15741558
// invalid
1575-
// @todo fix iterators without a hashtable
1576-
// @todo test Php::empty() function
15771559
return ValueIterator(nullptr,true);
15781560
}
15791561

0 commit comments

Comments
 (0)