OSDN Git Service

Minor code cleanups in vector.
authorJeff Brown <jeffbrown@google.com>
Thu, 14 Jul 2011 07:29:49 +0000 (00:29 -0700)
committerJeff Brown <jeffbrown@google.com>
Thu, 14 Jul 2011 11:11:23 +0000 (04:11 -0700)
commitc1053339974b52f7338cd2076f6ef6524a6fcfd5
tree8320d89713f4277f6ed25399ecca8bd3077c9039
parent686f62fcaf4ce2f48d662fa89fb2e84ee9339c4d
Minor code cleanups in vector.

Fixed a potential bug where calling replaceAt with a reference to
an existing element in the vector at the same index would cause
the element to be destroyed while being copied to itself.

Refactored the conditions in _grow and _shrink for clarity.
The computations are exactly the same but I think it reads better
this way.  In particular, the ssize_t variable 's' is gone: it didn't
need to be signed anyways because its value could never be negative.

Change-Id: If087841c15e6a87160eee874720c4a77eb0e99a6
libs/utils/VectorImpl.cpp