Convert Vector usage to std::vector
Prefer std::vector implementation over the custom Vector data type.
Bug: 278299254
Test: atest android.view.cts.KeyCharacterMapTest
Change-Id: If5b4e270a5c89c56619ae0c576495024438bd651
diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp
index 136a560..f703901 100644
--- a/libs/input/KeyCharacterMap.cpp
+++ b/libs/input/KeyCharacterMap.cpp
@@ -1050,14 +1050,14 @@
return finishKey(*key);
}
- Vector<Property> properties;
+ std::vector<Property> properties;
// Parse all comma-delimited property names up to the first colon.
for (;;) {
if (token == "label") {
- properties.add(Property(PROPERTY_LABEL));
+ properties.emplace_back(PROPERTY_LABEL);
} else if (token == "number") {
- properties.add(Property(PROPERTY_NUMBER));
+ properties.emplace_back(PROPERTY_NUMBER);
} else {
int32_t metaState;
status_t status = parseModifier(token.string(), &metaState);
@@ -1066,7 +1066,7 @@
mTokenizer->getLocation().string(), token.string());
return status;
}
- properties.add(Property(PROPERTY_META, metaState));
+ properties.emplace_back(PROPERTY_META, metaState);
}
mTokenizer->skipDelimiters(WHITESPACE);
@@ -1181,8 +1181,7 @@
} while (!mTokenizer->isEol() && mTokenizer->peekChar() != '#');
// Add the behavior.
- for (size_t i = 0; i < properties.size(); i++) {
- const Property& property = properties.itemAt(i);
+ for (const Property& property : properties) {
switch (property.property) {
case PROPERTY_LABEL:
if (key->label) {