[PATCH] D51690: [clangd] NFC: mark single-parameter constructors explicit
Kirill Bobyrev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 6 06:07:10 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL341543: [clangd] NFC: mark single-parameter constructors explicit (authored by omtcyfz, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D51690?vs=164065&id=164198#toc
Repository:
rL LLVM
https://reviews.llvm.org/D51690
Files:
clang-tools-extra/trunk/clangd/index/dex/Iterator.cpp
Index: clang-tools-extra/trunk/clangd/index/dex/Iterator.cpp
===================================================================
--- clang-tools-extra/trunk/clangd/index/dex/Iterator.cpp
+++ clang-tools-extra/trunk/clangd/index/dex/Iterator.cpp
@@ -23,7 +23,7 @@
/// tree) and is simply a wrapper around PostingList::const_iterator.
class DocumentIterator : public Iterator {
public:
- DocumentIterator(PostingListRef Documents)
+ explicit DocumentIterator(PostingListRef Documents)
: Documents(Documents), Index(std::begin(Documents)) {}
bool reachedEnd() const override { return Index == std::end(Documents); }
@@ -85,7 +85,7 @@
/// iterator restores the invariant: all children must point to the same item.
class AndIterator : public Iterator {
public:
- AndIterator(std::vector<std::unique_ptr<Iterator>> AllChildren)
+ explicit AndIterator(std::vector<std::unique_ptr<Iterator>> AllChildren)
: Children(std::move(AllChildren)) {
assert(!Children.empty() && "AND iterator should have at least one child.");
// Establish invariants.
@@ -193,7 +193,7 @@
/// soon as all of its children are exhausted.
class OrIterator : public Iterator {
public:
- OrIterator(std::vector<std::unique_ptr<Iterator>> AllChildren)
+ explicit OrIterator(std::vector<std::unique_ptr<Iterator>> AllChildren)
: Children(std::move(AllChildren)) {
assert(Children.size() > 0 && "OR iterator must have at least one child.");
}
@@ -279,7 +279,7 @@
/// in O(1).
class TrueIterator : public Iterator {
public:
- TrueIterator(DocID Size) : Size(Size) {}
+ explicit TrueIterator(DocID Size) : Size(Size) {}
bool reachedEnd() const override { return Index >= Size; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51690.164198.patch
Type: text/x-patch
Size: 1707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180906/229d93c9/attachment.bin>
More information about the llvm-commits
mailing list