summaryrefslogtreecommitdiff
path: root/src/mongo/bson/mutable/element.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/bson/mutable/element.h')
-rw-r--r--src/mongo/bson/mutable/element.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/bson/mutable/element.h b/src/mongo/bson/mutable/element.h
index c60bd4ea589..a0312c31b12 100644
--- a/src/mongo/bson/mutable/element.h
+++ b/src/mongo/bson/mutable/element.h
@@ -760,10 +760,7 @@ inline Element::Element(Document* doc, RepIdx repIdx) : _doc(doc), _repIdx(repId
}
inline StringData Element::getValueStringOrSymbol() const {
- const BSONElement value = getValue();
- const char* str = value.valuestr();
- const size_t size = value.valuestrsize() - 1;
- return StringData(str, size);
+ return getValue().valueStringData();
}
inline bool operator==(const Element& l, const Element& r) {