From cdf4362c7dd69ae32d3fbea09e07ad81ff1da4b8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 25 Feb 2020 20:49:18 +0100 Subject: [PATCH] List: add method empty() --- src/List.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/List.h b/src/List.h index 2b25dfb6f8..16393a34ed 100644 --- a/src/List.h +++ b/src/List.h @@ -135,6 +135,8 @@ public: num_entries = max_entries = 0; } + bool empty() const noexcept { return num_entries == 0; } + int length() const { return num_entries; } int max() const { return max_entries; } int resize(int new_size = 0) // 0 => size to fit current number of entries