vec.data() and vec.data() + vec.size() are both safe even if the vector is empty.
llvm-svn: 234436
This commit is contained in:
parent
1e67707a66
commit
5d6ff3d2ee
|
@ -199,14 +199,12 @@ protected:
|
|||
class atom_collection_vector : public atom_collection<T> {
|
||||
public:
|
||||
atom_iterator<T> begin() const override {
|
||||
auto *it = _atoms.empty() ? nullptr
|
||||
: reinterpret_cast<const void *>(_atoms.data());
|
||||
const void *it = _atoms.data();
|
||||
return atom_iterator<T>(*this, it);
|
||||
}
|
||||
|
||||
atom_iterator<T> end() const override {
|
||||
auto *it = _atoms.empty() ? nullptr : reinterpret_cast<const void *>(
|
||||
_atoms.data() + _atoms.size());
|
||||
const void *it = _atoms.data() + _atoms.size();
|
||||
return atom_iterator<T>(*this, it);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue