diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2019-05-08 11:12:49 -0400 |
---|---|---|
committer | Ted Tuckman <ted.tuckman@mongodb.com> | 2019-05-28 17:43:57 -0400 |
commit | 530167637e22f2cff3ddd8551f3229db6ed97824 (patch) | |
tree | 3c42daa85a74c951fd5d63e03cf7ded1cc867827 /src/mongo/db/field_ref.cpp | |
parent | fc6edc2f454ae29b1daaa0f2547b8204aa27bf72 (diff) | |
download | mongo-530167637e22f2cff3ddd8551f3229db6ed97824.tar.gz |
SERVER-40826 Add getters to projection nodes
Diffstat (limited to 'src/mongo/db/field_ref.cpp')
-rw-r--r-- | src/mongo/db/field_ref.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/field_ref.cpp b/src/mongo/db/field_ref.cpp index 35bc6a25a5c..c919a5df7c9 100644 --- a/src/mongo/db/field_ref.cpp +++ b/src/mongo/db/field_ref.cpp @@ -139,6 +139,16 @@ void FieldRef::removeLastPart() { _size--; } +void FieldRef::removeFirstPart() { + if (_size == 0) { + return; + } + for (size_t i = 0; i + 1 < _size; ++i) { + setPart(i, getPart(i + 1)); + } + removeLastPart(); +} + size_t FieldRef::appendParsedPart(FieldRef::StringView part) { if (_size < kReserveAhead) { _fixed[_size] = part; |