summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-04-15 23:11:59 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-04-23 15:58:50 +0100
commit66e1845cbdd20019f49345198af51e623a72b38b (patch)
treec87865103fb12c967e21e2e8b39443a8017cbd4f
parent7ad63d23d74e5bc45c44a0192ab1f49ceb68ffa7 (diff)
downloadceph-66e1845cbdd20019f49345198af51e623a72b38b.tar.gz
mon: MonitorDBStore: use stringify()
Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/MonitorDBStore.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/mon/MonitorDBStore.h b/src/mon/MonitorDBStore.h
index ac2703ec5e6..035029ba70e 100644
--- a/src/mon/MonitorDBStore.h
+++ b/src/mon/MonitorDBStore.h
@@ -24,6 +24,7 @@
#include "os/LevelDBStore.h"
#include "include/assert.h"
+#include "include/stringify.h"
#include "common/Formatter.h"
#include "common/errno.h"
@@ -77,9 +78,7 @@ class MonitorDBStore
}
void put(string prefix, version_t ver, bufferlist& bl) {
- ostringstream os;
- os << ver;
- put(prefix, os.str(), bl);
+ put(prefix, stringify(ver), bl);
}
void put(string prefix, string key, version_t ver) {
@@ -93,9 +92,7 @@ class MonitorDBStore
}
void erase(string prefix, version_t ver) {
- ostringstream os;
- os << ver;
- erase(prefix, os.str());
+ erase(prefix, stringify(ver));
}
void encode(bufferlist& bl) const {
@@ -384,9 +381,7 @@ class MonitorDBStore
}
int get(const string& prefix, const version_t ver, bufferlist& bl) {
- ostringstream os;
- os << ver;
- return get(prefix, os.str(), bl);
+ return get(prefix, stringify(ver), bl);
}
version_t get(const string& prefix, const string& key) {
@@ -420,9 +415,7 @@ class MonitorDBStore
}
bool exists(const string& prefix, version_t ver) {
- ostringstream os;
- os << ver;
- return exists(prefix, os.str());
+ return exists(prefix, stringify(ver));
}
string combine_strings(const string& prefix, const string& value) {
@@ -433,9 +426,7 @@ class MonitorDBStore
}
string combine_strings(const string& prefix, const version_t ver) {
- ostringstream os;
- os << ver;
- return combine_strings(prefix, os.str());
+ return combine_strings(prefix, stringify(ver));
}
void clear(set<string>& prefixes) {