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

Commit bea77a07 authored by John Reck's avatar John Reck
Browse files

Deep-copying sucks when all you want is a borrow

Bug: 22378829

std::string only knows how to move & deep-copy, and we really
don't want either here since the Paint object for certain outlives
the stack scope so use a const reference instead.

Change-Id: I1c822c6ba9647953899cfe89dcc670d7265e3973
parent 171fe6ac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ FontStyle MinikinUtils::prepareMinikinPaint(MinikinPaint* minikinPaint, FontColl
    FontStyle resolved = resolvedFace->fStyle;

    /* Prepare minikin FontStyle */
    std::string lang = paint->getTextLocale();
    const std::string& lang = paint->getTextLocale();
    FontLanguage minikinLang(lang.c_str(), lang.size());
    FontVariant minikinVariant = (paint->getFontVariant() == VARIANT_ELEGANT) ? VARIANT_ELEGANT
            : VARIANT_COMPACT;
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public:
        mTextLocale = textLocale;
    }

    std::string getTextLocale() const {
    const std::string& getTextLocale() const {
        return mTextLocale;
    }