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

Commit 6946d41e authored by Greg Kaiser's avatar Greg Kaiser
Browse files

Avoid a couple string copies

We pass by const reference, instead of by value/copy, in a
couple places.

Test: TreeHugger
Bug: 200055138
Bug: 170964303
Change-Id: I8a0e642b06beab0b92676017cd6e1f50536a2d79
parent 12935731
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ using ::android::os::PersistableBundle;

namespace {

std::string GetAttributeName(std::string typeName, uint32_t attribute) {
std::string GetAttributeName(const std::string &typeName, uint32_t attribute) {
    if (typeName == "KeyStatusChange") {
        static const char *type_names[] = {"USABLE", "EXPIRED",
                                       "OUTPUT_NOT_ALLOWED", "STATUS_PENDING",
@@ -85,7 +85,7 @@ void ExportCounterMetric(const android::CounterMetric<T> &counter,

template <typename T>
void ExportCounterMetricWithAttributeNames(
    const android::CounterMetric<T> &counter, std::string typeName, PersistableBundle *metrics) {
    const android::CounterMetric<T> &counter, const std::string &typeName, PersistableBundle *metrics) {
    if (!metrics) {
        ALOGE("metrics was unexpectedly null.");
        return;