From 42bf30651ba6632e04febaf1a059885c3daaf114 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Mon, 17 Sep 2018 15:18:57 -0700 Subject: [PATCH] Fix clang-tidy performance warnings in system/core. * Use more efficient overloaded string methods. Bug: 30411878 Test: build with WITH_TIDY=1 Change-Id: I449347565f83fae14ea337d0b3173beb5a56e0ca --- init/modalias_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/modalias_handler.cpp b/init/modalias_handler.cpp index 1e0db5731..c61c21039 100644 --- a/init/modalias_handler.cpp +++ b/init/modalias_handler.cpp @@ -50,7 +50,7 @@ Result ModaliasHandler::ParseDepCallback(std::vector&& arg } // Key is striped module name to match names in alias file - std::size_t start = args[0].find_last_of("/"); + std::size_t start = args[0].find_last_of('/'); std::size_t end = args[0].find(".ko:"); if ((end - start) <= 1) return Error() << "malformed dependency line"; auto mod_name = args[0].substr(start + 1, (end - start) - 1);