forked from OSchip/llvm-project
[clangd] NFC: mark single-parameter constructors explicit
Code health: prevent implicit conversions to user-defined types. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D51690 llvm-svn: 341543
This commit is contained in:
parent
19a9461e5f
commit
e4ee0213d4
|
@ -23,7 +23,7 @@ namespace {
|
|||
/// 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 @@ private:
|
|||
/// 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 @@ private:
|
|||
/// 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 @@ private:
|
|||
/// 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; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue