diff options
author | nyamatongwe <unknown> | 2013-05-02 15:41:52 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-05-02 15:41:52 +1000 |
commit | 92c16e3c4faa73974735c00b7cef99ae62416ad1 (patch) | |
tree | 730b9f18d0f204d81c93d4189786be85d702209c /lexlib/PropSetSimple.cxx | |
parent | 446852f3610b7390f6ca4376f6661aa4bf1b2f88 (diff) | |
download | scintilla-mirror-92c16e3c4faa73974735c00b7cef99ae62416ad1.tar.gz |
Remove Expanded method which was not used by any client code.
Diffstat (limited to 'lexlib/PropSetSimple.cxx')
-rw-r--r-- | lexlib/PropSetSimple.cxx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/lexlib/PropSetSimple.cxx b/lexlib/PropSetSimple.cxx index c0ec59459..9197fb642 100644 --- a/lexlib/PropSetSimple.cxx +++ b/lexlib/PropSetSimple.cxx @@ -141,30 +141,21 @@ static int ExpandAllInPlace(const PropSetSimple &props, std::string &withVars, i return maxExpands; } -char *PropSetSimple::Expanded(const char *key) const { +int PropSetSimple::GetExpanded(const char *key, char *result) const { std::string val = Get(key); ExpandAllInPlace(*this, val, 100, VarChain(key)); - char *ret = new char [val.size() + 1]; - strcpy(ret, val.c_str()); - return ret; -} - -int PropSetSimple::GetExpanded(const char *key, char *result) const { - char *val = Expanded(key); - const int n = static_cast<int>(strlen(val)); + const int n = static_cast<int>(val.size()); if (result) { - strcpy(result, val); + strcpy(result, val.c_str()); } - delete []val; return n; // Not including NUL } int PropSetSimple::GetInt(const char *key, int defaultValue) const { - char *val = Expanded(key); - if (val) { - int retVal = val[0] ? atoi(val) : defaultValue; - delete []val; - return retVal; + std::string val = Get(key); + ExpandAllInPlace(*this, val, 100, VarChain(key)); + if (!val.empty()) { + return atoi(val.c_str()); } return defaultValue; } |