diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-11-27 00:39:13 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-11-28 14:37:06 +0100 |
commit | 436b39d9d1f38caeafdc9be15696ebe4162a02c8 (patch) | |
tree | b316085603caa651731f3d200928327618fa80af /winaccessibility/source | |
parent | c064e7f3b46d2e579ca4402f9cb5b7aba824fd0c (diff) |
winaccessibility: improve GenerateNewResId()
Change-Id: I81f98ca83b97bc2e3e419c7a37ad2a011932553b
(cherry picked from commit 0fb33f60ac08c853f14d19e6158994d092a82670)
Diffstat (limited to 'winaccessibility/source')
-rw-r--r-- | winaccessibility/source/service/ResIDGenerator.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/winaccessibility/source/service/ResIDGenerator.cxx b/winaccessibility/source/service/ResIDGenerator.cxx index f7da8fb208f7..8c21d9ab94b1 100644 --- a/winaccessibility/source/service/ResIDGenerator.cxx +++ b/winaccessibility/source/service/ResIDGenerator.cxx @@ -19,12 +19,8 @@ #include "ResIDGenerator.hxx" -/** - * Destructor - * - * @param - * @return - */ +#include <cassert> + ResIDGenerator::~ResIDGenerator() { } @@ -39,15 +35,13 @@ ResIDGenerator::~ResIDGenerator() */ long ResIDGenerator::GenerateNewResID() { - if (max == LONG_MAX) + if (!subList.empty()) { - if (!subList.empty()) - { - long nRes = *(subList.begin()); - subList.pop_front(); - return nRes; - } + long nRes = *(subList.begin()); + subList.pop_front(); + return nRes; } + assert(max < LONG_MAX); return -(++max); } |