diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2006-10-23 23:31:00 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2006-10-23 23:31:00 +0000 |
commit | 493991791e3c7232fa33f428177dbfc9b666adac (patch) | |
tree | f937218c26da44d35b11b3ddeee1804031b5d99a /ACE/ace/Service_Repository.cpp | |
parent | fe745d19b69bcac8e99ca5304656eada195cd1c6 (diff) | |
download | ATCD-493991791e3c7232fa33f428177dbfc9b666adac.tar.gz |
ChangeLogTag:Mon Oct 23 02:28:42 UTC 2006 Ossama Othman <ossama_othman at symantec dot com>
Diffstat (limited to 'ACE/ace/Service_Repository.cpp')
-rw-r--r-- | ACE/ace/Service_Repository.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ACE/ace/Service_Repository.cpp b/ACE/ace/Service_Repository.cpp index 9367cdcc296..c3b63ac5a97 100644 --- a/ACE/ace/Service_Repository.cpp +++ b/ACE/ace/Service_Repository.cpp @@ -149,7 +149,10 @@ ACE_Service_Repository::fini (void) // remove services, so typically they are deleted in reverse // order. - for (int i = this->current_size_ - 1; i >= 0; i--) + // Do not be tempted to use the prefix decrement operator. We + // need to use the postfix decrement operator in this case since + // the index is unsigned. + for (size_t i = this->current_size_; i-- != 0; ) { ACE_Service_Type *s = const_cast<ACE_Service_Type *> (this->service_vector_[i]); @@ -197,7 +200,10 @@ ACE_Service_Repository::close (void) this->current_size_)); #endif - for (int i = this->current_size_ - 1; i >= 0; i--) + // Do not be tempted to use the prefix decrement operator. We + // need to use the postfix decrement operator in this case since + // the index is unsigned. + for (size_t i = this->current_size_; i-- != 0; ) { #ifndef ACE_NLOGGING |