We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bab226 commit eca23daCopy full SHA for eca23da
src/rt/util/array_list.h
@@ -35,7 +35,7 @@ template<typename T> class array_list {
35
size_t size() const;
36
int32_t append(T value);
37
int32_t push(T value);
38
- bool pop(T *value);
+ void pop(T *value);
39
bool replace(T old_value, T new_value);
40
int32_t index_of(T value) const;
41
bool is_empty() const;
@@ -81,17 +81,14 @@ array_list<T>::push(T value) {
81
return _size - 1;
82
}
83
84
-template<typename T> bool
+template<typename T> void
85
array_list<T>::pop(T *value) {
86
- if (_size == 0) {
87
- return false;
88
- }
+ assert(_size > 0);
89
if (value != NULL) {
90
*value = _data[-- _size];
91
} else {
92
-- _size;
93
94
- return true;
95
96
97
/**
0 commit comments