diff options
author | Toon Schoenmakers <toon.schoenmakers@copernica.com> | 2014-08-19 11:07:37 +0200 |
---|---|---|
committer | Toon Schoenmakers <toon.schoenmakers@copernica.com> | 2014-08-19 11:07:37 +0200 |
commit | cc106471bee34549d0db18a6d3797e791853fc6c (patch) | |
tree | 0f71dde924ab67bc6ce2b8d26b610243e462259a /zend/value.cpp | |
parent | eac464b8b4428864817edbedf1fb79f6dac0dd3b (diff) |
Use stringValue() rather than checking if it's a numeric value to then use std::to_string()
Diffstat (limited to 'zend/value.cpp')
-rw-r--r-- | zend/value.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/zend/value.cpp b/zend/value.cpp index 3f38498..50c4b64 100644 --- a/zend/value.cpp +++ b/zend/value.cpp @@ -1708,15 +1708,10 @@ std::map<std::string,Php::Value> Value::mapValue() const { // result variable std::map<std::string,Php::Value> result; - + // iterate over the object - for (auto &iter : *this) - { - auto &key = iter.first; - if (key.isNumeric()) result[std::to_string(key.numericValue())] = iter.second; - else result[iter.first.rawValue()] = iter.second; - } - + for (auto &iter : *this) result[iter.first.stringValue()] = iter.second; + // done return result; } |