Fix clang-tidy warnings in bootable/recovery.

* Use const reference type for read-only parameters.
Bug: 30407689
* Use faster overloaded string find function.
Bug: 30411878
* Add parentheses around macro parameters.
Bug: 28705665

Test: build with WITH_TIDY=1
Change-Id: I4e8e5748bfa4ae89871f1fb5fa4624d372530d75
This commit is contained in:
Chih-Hung Hsieh
2016-08-26 14:54:29 -07:00
parent b3ddc0a4bf
commit 8b23811d2a
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -54,8 +54,8 @@ static const float DEFAULT_FILES_PROGRESS_FRACTION = 0.4;
static const float DEFAULT_IMAGE_PROGRESS_FRACTION = 0.1;
// This function parses and returns the build.version.incremental
static int parse_build_number(std::string str) {
size_t pos = str.find("=");
static int parse_build_number(const std::string& str) {
size_t pos = str.find('=');
if (pos != std::string::npos) {
std::string num_string = android::base::Trim(str.substr(pos+1));
int build_number;