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-18 00:01:24 +0100
commit68bdc86125bcfe5c96eb4dd741137350b8508e22 (patch)
treec41095f5e01149708b469bd3aff3200ee4b6fa14
parentee517ab325479b2f01b9ecfb0f276bc47360eb53 (diff)
downloadceph-68bdc86125bcfe5c96eb4dd741137350b8508e22.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) {