first_stage_init: Optimize redundant vector copy
``` std::vector<std::string> v2; for (auto&& e : get_temporary_v1()) { v2.push_back(e); } ``` ^^^ This is constructing v2 from a temporary object, which is an unnecessary manual clone. We should just let copy-elision do its thing: ``` // Give compiler the chance to optimize this with copy-elision... auto v2 = get_temporary_v1(); ``` Also `lp_names` appends an extra ',' at its end. Just use android::base::Join() here. Bug: 235111004 Test: Presubmit GSI boot test Change-Id: Ibe8ce7a29b8521e789aa0a99f7f6d31f3f9c70e9
Loading
Please register or sign in to comment