libcamera: utils: StringSplitter: Inline some trivial methods
Inline some of the more trivial methods so that they can be inlined by the compiler. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
b5fd7631e6
commit
f1bc9edb46
2 changed files with 14 additions and 18 deletions
|
@ -204,7 +204,11 @@ public:
|
||||||
|
|
||||||
iterator &operator++();
|
iterator &operator++();
|
||||||
std::string operator*() const;
|
std::string operator*() const;
|
||||||
bool operator!=(const iterator &other) const;
|
|
||||||
|
bool operator!=(const iterator &other) const
|
||||||
|
{
|
||||||
|
return pos_ != other.pos_;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const StringSplitter *ss_;
|
const StringSplitter *ss_;
|
||||||
|
@ -212,8 +216,15 @@ public:
|
||||||
std::string::size_type next_;
|
std::string::size_type next_;
|
||||||
};
|
};
|
||||||
|
|
||||||
iterator begin() const;
|
iterator begin() const
|
||||||
iterator end() const;
|
{
|
||||||
|
return { this, 0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator end() const
|
||||||
|
{
|
||||||
|
return { this, std::string::npos };
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string str_;
|
std::string str_;
|
||||||
|
|
|
@ -276,21 +276,6 @@ std::string details::StringSplitter::iterator::operator*() const
|
||||||
return ss_->str_.substr(pos_, count);
|
return ss_->str_.substr(pos_, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool details::StringSplitter::iterator::operator!=(const details::StringSplitter::iterator &other) const
|
|
||||||
{
|
|
||||||
return pos_ != other.pos_;
|
|
||||||
}
|
|
||||||
|
|
||||||
details::StringSplitter::iterator details::StringSplitter::begin() const
|
|
||||||
{
|
|
||||||
return iterator(this, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
details::StringSplitter::iterator details::StringSplitter::end() const
|
|
||||||
{
|
|
||||||
return iterator(this, std::string::npos);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \fn template<typename Container, typename UnaryOp> \
|
* \fn template<typename Container, typename UnaryOp> \
|
||||||
* std::string utils::join(const Container &items, const std::string &sep, UnaryOp op)
|
* std::string utils::join(const Container &items, const std::string &sep, UnaryOp op)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue