diff options
author | nyamatongwe <devnull@localhost> | 2013-05-02 15:41:52 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-05-02 15:41:52 +1000 |
commit | cb22e6da376c129ce45153b24fbb6a0ff9777a79 (patch) | |
tree | bb5876baf234503e4f3221c206b25faee10ad9ae | |
parent | 41e6eb7204924338444619d4b25e8f8d47f08846 (diff) | |
download | scintilla-mirror-cb22e6da376c129ce45153b24fbb6a0ff9777a79.tar.gz |
Remove Expanded method which was not used by any client code.
-rw-r--r-- | lexlib/PropSetSimple.cxx | 23 | ||||
-rw-r--r-- | lexlib/PropSetSimple.h | 1 |
2 files changed, 7 insertions, 17 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; } diff --git a/lexlib/PropSetSimple.h b/lexlib/PropSetSimple.h index b79873720..8ca741f03 100644 --- a/lexlib/PropSetSimple.h +++ b/lexlib/PropSetSimple.h @@ -21,7 +21,6 @@ public: void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1); void SetMultiple(const char *); const char *Get(const char *key) const; - char *Expanded(const char *key) const; int GetExpanded(const char *key, char *result) const; int GetInt(const char *key, int defaultValue=0) const; }; |