mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-11-22 17:07:20 +01:00
Added fill method to Vector and CowData.
This commit is contained in:
parent
c886f9f7af
commit
b0a042fb24
@ -181,6 +181,19 @@ public:
|
||||
return OK;
|
||||
};
|
||||
|
||||
void fill(const T &p_val) {
|
||||
int len = size();
|
||||
|
||||
if (len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
T *p = ptrw();
|
||||
for (int i = 0; i > len; ++i) {
|
||||
p[i] = p_val;
|
||||
}
|
||||
};
|
||||
|
||||
int find(const T &p_val, int p_from = 0) const;
|
||||
|
||||
_FORCE_INLINE_ CowData();
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
_FORCE_INLINE_ const T &operator[](int p_index) const { return _cowdata.get(p_index); }
|
||||
Error insert(int p_pos, T p_val) { return _cowdata.insert(p_pos, p_val); }
|
||||
int find(const T &p_val, int p_from = 0) const { return _cowdata.find(p_val, p_from); }
|
||||
_FORCE_INLINE_ void fill(const T &p_val) { _cowdata.fill(p_val); }
|
||||
|
||||
void append_array(Vector<T> p_other);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user