From 134a4083953270e8a11430395357fb70a29047ad Mon Sep 17 00:00:00 2001 From: "clang-format-7.0.1" Date: Fri, 26 Jul 2019 18:20:35 -0400 Subject: SERVER-41772 Apply clang-format 7.0.1 to the codebase --- src/mongo/db/sorter/sorter.cpp | 40 +++++++++++++++++----------------------- src/mongo/db/sorter/sorter.h | 2 +- 2 files changed, 18 insertions(+), 24 deletions(-) (limited to 'src/mongo/db/sorter') diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index 25d1b9e77f1..663e0f47c6f 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -188,24 +188,21 @@ public: void openSource() { _file.open(_fileName.c_str(), std::ios::in | std::ios::binary); uassert(16814, - str::stream() << "error opening file \"" << _fileName << "\": " - << myErrnoWithDescription(), + str::stream() << "error opening file \"" << _fileName + << "\": " << myErrnoWithDescription(), _file.good()); _file.seekg(_fileStartOffset); uassert(50979, str::stream() << "error seeking starting offset of '" << _fileStartOffset - << "' in file \"" - << _fileName - << "\": " - << myErrnoWithDescription(), + << "' in file \"" << _fileName << "\": " << myErrnoWithDescription(), _file.good()); } void closeSource() { _file.close(); uassert(50969, - str::stream() << "error closing file \"" << _fileName << "\": " - << myErrnoWithDescription(), + str::stream() << "error closing file \"" << _fileName + << "\": " << myErrnoWithDescription(), !_file.fail()); // If the file iterator reads through all data objects, we can ensure non-corrupt data @@ -328,8 +325,8 @@ private: const std::streampos offset = _file.tellg(); uassert(51049, - str::stream() << "error reading file \"" << _fileName << "\": " - << myErrnoWithDescription(), + str::stream() << "error reading file \"" << _fileName + << "\": " << myErrnoWithDescription(), offset >= 0); if (offset >= _fileEndOffset) { @@ -340,8 +337,8 @@ private: _file.read(reinterpret_cast(out), size); uassert(16817, - str::stream() << "error reading file \"" << _fileName << "\": " - << myErrnoWithDescription(), + str::stream() << "error reading file \"" << _fileName + << "\": " << myErrnoWithDescription(), _file.good()); verify(_file.gcount() == static_cast(size)); } @@ -605,8 +602,7 @@ private: // need to be revisited. uasserted(16819, str::stream() - << "Sort exceeded memory limit of " - << _opts.maxMemoryUsageBytes + << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes << " bytes, but did not opt in to external sorting. Aborting operation." << " Pass allowDiskUse:true to opt in."); } @@ -893,8 +889,7 @@ private: // need to be revisited. uasserted(16820, str::stream() - << "Sort exceeded memory limit of " - << _opts.maxMemoryUsageBytes + << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes << " bytes, but did not opt in to external sorting. Aborting operation." << " Pass allowDiskUse:true to opt in."); } @@ -970,8 +965,8 @@ SortedFileWriter::SortedFileWriter(const SortOptions& opts, // limits. _file.open(_fileName.c_str(), std::ios::binary | std::ios::app | std::ios::out); uassert(16818, - str::stream() << "error opening file \"" << _fileName << "\": " - << sorter::myErrnoWithDescription(), + str::stream() << "error opening file \"" << _fileName + << "\": " << sorter::myErrnoWithDescription(), _file.good()); // The file descriptor is positioned at the end of a file when opened in append mode, but // _file.tellp() is not initialized on all systems to reflect this. Therefore, we must also pass @@ -1044,8 +1039,8 @@ void SortedFileWriter::spill() { _file.write(outBuffer, std::abs(size)); } catch (const std::exception&) { msgasserted(16821, - str::stream() << "error writing to file \"" << _fileName << "\": " - << sorter::myErrnoWithDescription()); + str::stream() << "error writing to file \"" << _fileName + << "\": " << sorter::myErrnoWithDescription()); } _buffer.reset(); @@ -1057,8 +1052,7 @@ SortIteratorInterface* SortedFileWriter::done() { std::streampos currentFileOffset = _file.tellp(); uassert(50980, str::stream() << "error fetching current file descriptor offset in file \"" << _fileName - << "\": " - << sorter::myErrnoWithDescription(), + << "\": " << sorter::myErrnoWithDescription(), currentFileOffset >= 0); // In case nothing was written to disk, use _fileStartOffset because tellp() may not be @@ -1106,4 +1100,4 @@ Sorter* Sorter::make(const SortOptions& opts, return new sorter::TopKSorter(opts, comp, settings); } } -} +} // namespace mongo diff --git a/src/mongo/db/sorter/sorter.h b/src/mongo/db/sorter/sorter.h index 87d80a45f92..4dd6f4fc4c5 100644 --- a/src/mongo/db/sorter/sorter.h +++ b/src/mongo/db/sorter/sorter.h @@ -272,7 +272,7 @@ private: std::streampos _fileStartOffset; std::streampos _fileEndOffset; }; -} +} // namespace mongo /** * #include "mongo/db/sorter/sorter.cpp" and call this in a single translation -- cgit v1.2.1