diff options
author | clang-format 12.0.1 <> | 2023-02-10 04:44:29 -0800 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-11 08:00:01 +0000 |
commit | f63255ee677ecae5896d6f35dd712ed60ae8c39a (patch) | |
tree | 97ffffa8d6f9e1a131aeb1ccc1d42f133f8407fd /src/mongo/bson/util | |
parent | 375366e3f317d18717df24f861b09c4d2f8fb27f (diff) | |
download | mongo-f63255ee677ecae5896d6f35dd712ed60ae8c39a.tar.gz |
SERVER-72197 Run clang-format 12.0.1 on the codebase
Signed-off-by: Ryan Egesdahl <ryan.egesdahl@mongodb.com>
Diffstat (limited to 'src/mongo/bson/util')
-rw-r--r-- | src/mongo/bson/util/bson_extract_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/bson/util/bsoncolumn.cpp | 17 | ||||
-rw-r--r-- | src/mongo/bson/util/bsoncolumnbuilder.cpp | 12 | ||||
-rw-r--r-- | src/mongo/bson/util/builder_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/bson/util/simple8b.cpp | 2 |
5 files changed, 23 insertions, 16 deletions
diff --git a/src/mongo/bson/util/bson_extract_test.cpp b/src/mongo/bson/util/bson_extract_test.cpp index a06aa202900..2573e6739ab 100644 --- a/src/mongo/bson/util/bson_extract_test.cpp +++ b/src/mongo/bson/util/bson_extract_test.cpp @@ -139,7 +139,9 @@ TEST(ExtractBSON, ExtractIntegerField) { ASSERT_EQUALS(-(1LL << 55), v); ASSERT_OK(bsonExtractIntegerField(BSON("a" << 5178), "a", &v)); ASSERT_EQUALS(5178, v); - auto pred = [](long long x) { return x > 0; }; + auto pred = [](long long x) { + return x > 0; + }; ASSERT_OK(bsonExtractIntegerFieldWithDefaultIf(BSON("a" << 1), "a", -1LL, pred, &v)); ASSERT_OK(bsonExtractIntegerFieldWithDefaultIf(BSON("a" << 1), "b", 1LL, pred, &v)); auto msg = "'a' has to be greater than zero"; diff --git a/src/mongo/bson/util/bsoncolumn.cpp b/src/mongo/bson/util/bsoncolumn.cpp index 63ae732840c..be48dfa3580 100644 --- a/src/mongo/bson/util/bsoncolumn.cpp +++ b/src/mongo/bson/util/bsoncolumn.cpp @@ -324,14 +324,15 @@ void BSONColumn::Iterator::_initializeInterleaving() { *_control == bsoncolumn::kInterleavedStartArrayRootControlByte ? Array : Object; _interleavedReferenceObj = BSONObj(_control + 1); - BSONObjTraversal t(_interleavedArrays, - _interleavedRootType, - [](StringData fieldName, const BSONObj& obj, BSONType type) { return true; }, - [this](const BSONElement& elem) { - _states.emplace_back(); - _states.back()._loadLiteral(elem); - return true; - }); + BSONObjTraversal t( + _interleavedArrays, + _interleavedRootType, + [](StringData fieldName, const BSONObj& obj, BSONType type) { return true; }, + [this](const BSONElement& elem) { + _states.emplace_back(); + _states.back()._loadLiteral(elem); + return true; + }); t.traverse(_interleavedReferenceObj); uassert(6067610, "Invalid BSONColumn encoding", !_states.empty()); diff --git a/src/mongo/bson/util/bsoncolumnbuilder.cpp b/src/mongo/bson/util/bsoncolumnbuilder.cpp index 5e89309c2cd..762fc11fb72 100644 --- a/src/mongo/bson/util/bsoncolumnbuilder.cpp +++ b/src/mongo/bson/util/bsoncolumnbuilder.cpp @@ -364,7 +364,9 @@ BSONColumnBuilder& BSONColumnBuilder::_appendObj(Element elem) { ++numElementsReferenceObj; }; if (!traverseLockStep(_is.referenceSubObj, obj, perElementLockStep)) { - BSONObj merged = [&] { return mergeObj(_is.referenceSubObj, obj); }(); + BSONObj merged = [&] { + return mergeObj(_is.referenceSubObj, obj); + }(); if (merged.isEmptyPrototype()) { // If merge failed, flush current sub-object compression and start over. _flushSubObjMode(); @@ -993,8 +995,8 @@ BSONColumnBuilder::InternalState::SubObjState::SubObjState(SubObjState&& other) state.init(&buffer, controlBlockWriter()); } -BSONColumnBuilder::InternalState::SubObjState& BSONColumnBuilder::InternalState::SubObjState:: -operator=(const SubObjState& rhs) { +BSONColumnBuilder::InternalState::SubObjState& +BSONColumnBuilder::InternalState::SubObjState::operator=(const SubObjState& rhs) { if (&rhs == this) return *this; @@ -1005,8 +1007,8 @@ operator=(const SubObjState& rhs) { return *this; } -BSONColumnBuilder::InternalState::SubObjState& BSONColumnBuilder::InternalState::SubObjState:: -operator=(SubObjState&& rhs) { +BSONColumnBuilder::InternalState::SubObjState& +BSONColumnBuilder::InternalState::SubObjState::operator=(SubObjState&& rhs) { if (&rhs == this) return *this; diff --git a/src/mongo/bson/util/builder_test.cpp b/src/mongo/bson/util/builder_test.cpp index a4ed4c87115..8344c43b839 100644 --- a/src/mongo/bson/util/builder_test.cpp +++ b/src/mongo/bson/util/builder_test.cpp @@ -86,7 +86,9 @@ TEST(Builder, StackAllocatorShouldNotLeak) { template <typename T> void testStringBuilderIntegral() { - auto check = [](T num) { ASSERT_EQ(std::string(str::stream() << num), std::to_string(num)); }; + auto check = [](T num) { + ASSERT_EQ(std::string(str::stream() << num), std::to_string(num)); + }; // Do some simple sanity checks. check(0); diff --git a/src/mongo/bson/util/simple8b.cpp b/src/mongo/bson/util/simple8b.cpp index 01b7ead40b2..54114375e83 100644 --- a/src/mongo/bson/util/simple8b.cpp +++ b/src/mongo/bson/util/simple8b.cpp @@ -357,7 +357,7 @@ Simple8bBuilder<T>::PendingIterator::PendingIterator( : _begin(beginning), _it(it), _rleValue(rleValue), _rleCount(rleCount) {} template <typename T> -auto Simple8bBuilder<T>::PendingIterator::operator-> () const -> pointer { +auto Simple8bBuilder<T>::PendingIterator::operator->() const -> pointer { return &operator*(); } |