8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 15:23:02 +01:00

New methods for array classes

This commit is contained in:
asfernandes 2008-09-14 22:45:00 +00:00
parent 4f469c3355
commit 25d751ea32
2 changed files with 6 additions and 1 deletions

View File

@ -313,6 +313,10 @@ public:
// Used as such in GlobalRWLock::blockingAstHandler // Used as such in GlobalRWLock::blockingAstHandler
size_t getCount() const { return count; } size_t getCount() const { return count; }
bool isEmpty() const { return count == 0; }
bool hasData() const { return count != 0; }
size_t getCapacity() const { return capacity; } size_t getCapacity() const { return capacity; }
void push(const T& item) void push(const T& item)
@ -326,6 +330,7 @@ public:
memcpy(data + count, items, sizeof(T) * itemsSize); memcpy(data + count, items, sizeof(T) * itemsSize);
count += itemsSize; count += itemsSize;
} }
T pop() T pop()
{ {
fb_assert(count > 0); fb_assert(count > 0);

View File

@ -1895,7 +1895,7 @@ InversionCandidate* OptimizerRetrieval::makeInversion(InversionCandidateList* in
* *
**************************************/ **************************************/
if (!inversions->getCount()) { if (inversions->isEmpty()) {
return NULL; return NULL;
} }