mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
AK: Vector::data() shouldn't crash if the vector is empty.
It's up to the caller to check size() and stay within the bounds.
This commit is contained in:
parent
a32b33621f
commit
d459525725
4 changed files with 9481 additions and 2 deletions
|
@ -122,8 +122,8 @@ public:
|
|||
size_t size() const { return m_impl ? m_impl->size() : 0; }
|
||||
size_t capacity() const { return m_impl ? m_impl->capacity() : 0; }
|
||||
|
||||
T* data() { return m_impl ? &at(0) : nullptr; }
|
||||
const T* data() const { return m_impl ? &at(0) : nullptr; }
|
||||
T* data() { return m_impl ? m_impl->slot(0) : nullptr; }
|
||||
const T* data() const { return m_impl ? m_impl->slot(0) : nullptr; }
|
||||
|
||||
const T& at(size_t i) const { return m_impl->at(i); }
|
||||
T& at(size_t i) { return m_impl->at(i); }
|
||||
|
|
4895
AK/emmintrin.h
Normal file
4895
AK/emmintrin.h
Normal file
File diff suppressed because it is too large
Load diff
1572
AK/mmintrin.h
Normal file
1572
AK/mmintrin.h
Normal file
File diff suppressed because it is too large
Load diff
3012
AK/xmmintrin.h
Normal file
3012
AK/xmmintrin.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue