AK: Vector::is_null() should always return false

This is only used by the somewhat dubious templated String::copy().
An empty Vector should generate an empty String when copied, never
a null String.
This commit is contained in:
Andreas Kling 2020-01-25 12:14:59 +01:00
parent b648997d1f
commit 003d52ce6e
Notes: sideshowbarker 2024-07-19 09:50:27 +09:00

View file

@ -249,7 +249,7 @@ public:
}
// NOTE: Vector::is_null() exists for the benefit of String::copy().
bool is_null() const { return is_empty(); }
bool is_null() const { return false; }
bool is_empty() const { return size() == 0; }
int size() const { return m_size; }
int capacity() const { return m_capacity; }