Skip to content

Commit

Permalink
removed Value constructor that wraps around a hash table
Browse files Browse the repository at this point in the history
  • Loading branch information
EmielBruijntjes committed Mar 16, 2014
1 parent b535eb7 commit 03a2749
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
8 changes: 2 additions & 6 deletions include/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ class Value
*/
Value(struct _zval_struct *zval, bool ref = false);

/**
* Wrap around a hash table
* @param ht Hashtable to wrap
*/
Value(struct _hashtable *ht);

/**
* Wrap around an object implemented by us
* @param object Object to be wrapped
Expand Down Expand Up @@ -445,6 +439,8 @@ class Value
template <typename T>
std::vector<T> vectorValue() const
{


// only works for arrays, other types return an empty vector
if (!isArray()) return std::vector<T>();

Expand Down
18 changes: 0 additions & 18 deletions src/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,6 @@ Value::Value(struct _zval_struct *val, bool ref)
Z_SET_ISREF_P(_val);
}

/**
* Wrap around a hash table
* @param ht Hashtable to wrap
*/
Value::Value(HashTable *ht)
{
// construct a zval
MAKE_STD_ZVAL(_val);
Z_ARRVAL_P(_val) = ht;
Z_TYPE_P(_val) = IS_ARRAY;

// add a reference
// @todo this may be wrong
Z_ADDREF_P(_val);
}

/**
* Wrap around an object
* @param object
Expand Down Expand Up @@ -1572,8 +1556,6 @@ ValueIterator Value::begin() const
if (isObject()) return ValueIterator(Z_OBJ_HT_P(_val)->get_properties(_val), true);

// invalid
// @todo fix iterators without a hashtable
// @todo test Php::empty() function
return ValueIterator(nullptr,true);
}

Expand Down

0 comments on commit 03a2749

Please sign in to comment.