aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlib/PropSetSimple.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-05-02 15:41:52 +1000
committernyamatongwe <devnull@localhost>2013-05-02 15:41:52 +1000
commitcb22e6da376c129ce45153b24fbb6a0ff9777a79 (patch)
treebb5876baf234503e4f3221c206b25faee10ad9ae /lexlib/PropSetSimple.cxx
parent41e6eb7204924338444619d4b25e8f8d47f08846 (diff)
downloadscintilla-mirror-cb22e6da376c129ce45153b24fbb6a0ff9777a79.tar.gz
Remove Expanded method which was not used by any client code.
Diffstat (limited to 'lexlib/PropSetSimple.cxx')
-rw-r--r--lexlib/PropSetSimple.cxx23
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;
}