summaryrefslogtreecommitdiff
path: root/AK/Queue.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-28 21:21:09 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-28 21:34:47 +0200
commit66db6f4f925965c33bb8b27452c3c210f0b924ce (patch)
tree96184dec3f57c67a28f212ce3b0a9dbb88d9c817 /AK/Queue.h
parent731f91f1ab940f134886e034661e62f9862291e0 (diff)
downloadserenity-66db6f4f925965c33bb8b27452c3c210f0b924ce.zip
AK: Add Queue::clear() to clear out a Queue.
Diffstat (limited to 'AK/Queue.h')
-rw-r--r--AK/Queue.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/AK/Queue.h b/AK/Queue.h
index 8ae0fc094b..7a21c51b3a 100644
--- a/AK/Queue.h
+++ b/AK/Queue.h
@@ -40,6 +40,13 @@ public:
return value;
}
+ void clear()
+ {
+ m_segments.clear();
+ m_index_into_first = 0;
+ m_size = 0;
+ }
+
private:
static const int segment_size = 1000;