diff options
author | 2023-04-17 16:11:22 -0700 | |
---|---|---|
committer | 2023-04-18 08:16:03 -0700 | |
commit | edcd042535eb2f56100f69593b502770b9bee92d (patch) | |
tree | fd623d95c30c7d75fd919298c06ca4f94ccd5f35 /libs/input/KeyCharacterMap.cpp | |
parent | 10b9a063ac159d7bbb12ed140c6efeab8b1ef2e2 (diff) |
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
Diffstat (limited to 'libs/input/KeyCharacterMap.cpp')
-rw-r--r-- | libs/input/KeyCharacterMap.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp index 136a560aea..f703901ed9 100644 --- a/libs/input/KeyCharacterMap.cpp +++ b/libs/input/KeyCharacterMap.cpp @@ -1050,14 +1050,14 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { 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 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { 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 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() { } 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) { |