summaryrefslogtreecommitdiff
path: root/src/crush/CrushWrapper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crush/CrushWrapper.h')
-rw-r--r--src/crush/CrushWrapper.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h
index 7def6e4ab34..605874606f8 100644
--- a/src/crush/CrushWrapper.h
+++ b/src/crush/CrushWrapper.h
@@ -221,8 +221,11 @@ public:
}
// rule names
- int get_rule_id(const char *n) {
- string name(n);
+ bool rule_exists(string name) {
+ build_rmaps();
+ return rule_name_rmap.count(name);
+ }
+ int get_rule_id(string name) {
build_rmaps();
if (rule_name_rmap.count(name))
return rule_name_rmap[name];