Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5af2834b authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Pass reference to finishKey

Since the parameter is assumed to be non-null, pass it by reference.

Bug: 274058082
Test: m libinput_tests && $ANDROID_HOST_OUT/nativetest64/libinput_tests/libinput_tests
Change-Id: Iedf8970a57e4463e6addc8ee1013feb3ee60c009
parent 0fe0126d
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -227,7 +227,7 @@ private:
        status_t parseMapKey();
        status_t parseMapKey();
        status_t parseKey();
        status_t parseKey();
        status_t parseKeyProperty();
        status_t parseKeyProperty();
        status_t finishKey(Key* key);
        status_t finishKey(Key& key);
        status_t parseModifier(const std::string& token, int32_t* outMetaState);
        status_t parseModifier(const std::string& token, int32_t* outMetaState);
        status_t parseCharacterLiteral(char16_t* outCharacter);
        status_t parseCharacterLiteral(char16_t* outCharacter);
    };
    };
+5 −5
Original line number Original line Diff line number Diff line
@@ -1048,7 +1048,7 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() {
    String8 token = mTokenizer->nextToken(WHITESPACE_OR_PROPERTY_DELIMITER);
    String8 token = mTokenizer->nextToken(WHITESPACE_OR_PROPERTY_DELIMITER);
    if (token == "}") {
    if (token == "}") {
        mState = STATE_TOP;
        mState = STATE_TOP;
        return finishKey(key);
        return finishKey(*key);
    }
    }


    Vector<Property> properties;
    Vector<Property> properties;
@@ -1230,12 +1230,12 @@ status_t KeyCharacterMap::Parser::parseKeyProperty() {
    return NO_ERROR;
    return NO_ERROR;
}
}


status_t KeyCharacterMap::Parser::finishKey(Key* key) {
status_t KeyCharacterMap::Parser::finishKey(Key& key) {
    // Fill in default number property.
    // Fill in default number property.
    if (!key->number) {
    if (!key.number) {
        char16_t digit = 0;
        char16_t digit = 0;
        char16_t symbol = 0;
        char16_t symbol = 0;
        for (const Behavior& b : key->behaviors) {
        for (const Behavior& b : key.behaviors) {
            char16_t ch = b.character;
            char16_t ch = b.character;
            if (ch) {
            if (ch) {
                if (ch >= '0' && ch <= '9') {
                if (ch >= '0' && ch <= '9') {
@@ -1247,7 +1247,7 @@ status_t KeyCharacterMap::Parser::finishKey(Key* key) {
                }
                }
            }
            }
        }
        }
        key->number = digit ? digit : symbol;
        key.number = digit ? digit : symbol;
    }
    }
    return NO_ERROR;
    return NO_ERROR;
}
}