mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 19:23:03 +01:00
First add an element, next increase count - makes class safer in MT world
This commit is contained in:
parent
5ce35395c7
commit
e231c73051
@ -156,8 +156,8 @@ public:
|
||||
}
|
||||
size_t add(const T& item) {
|
||||
ensureCapacity(count + 1);
|
||||
data[count++] = item;
|
||||
return count;
|
||||
data[count] = item;
|
||||
return ++count;
|
||||
}
|
||||
// NOTE: remove method must be signal safe
|
||||
// This function may be called in AST. The function doesn't wait.
|
||||
|
@ -65,8 +65,8 @@ public:
|
||||
}
|
||||
size_t add(const T& item) {
|
||||
fb_assert(count < Capacity);
|
||||
data[count++] = item;
|
||||
return count;
|
||||
data[count] = item;
|
||||
return ++count;
|
||||
}
|
||||
T* remove(size_t index) {
|
||||
fb_assert(index < count);
|
||||
|
Loading…
Reference in New Issue
Block a user