refactor: apply some 'clang-tidy -fix' changes (#20172)
* refactor: fix clang-tidy vector operation warnings Fix vector population performance-inefficient-vector-operation warnings generated by clang-tidy * refactor: fix clang-tidy emplace_back warnings In cases where a temporary is created to be passed to push_back(), replace it with emplace_back(). Warning: modernize-use-emplace * refactor: fix clang-tidy loop iteration warnings When practical, use range-based for loops instead of C-style for loops. clang-tiny check: modernize-loop-convert * refactor: fix clang-tidy string initialize warning Remove redundant empty string initialization. clang-tidy check: readability-redundant-string-init
This commit is contained in:
parent
3ec17a88ba
commit
b2652beceb
19 changed files with 62 additions and 69 deletions
|
@ -96,7 +96,7 @@ content::RenderFrame* GetRenderFrame(v8::Local<v8::Value> value) {
|
|||
return content::RenderFrame::FromWebFrame(frame);
|
||||
}
|
||||
|
||||
class RenderFrameStatus : public content::RenderFrameObserver {
|
||||
class RenderFrameStatus final : public content::RenderFrameObserver {
|
||||
public:
|
||||
explicit RenderFrameStatus(content::RenderFrame* render_frame)
|
||||
: content::RenderFrameObserver(render_frame) {}
|
||||
|
@ -165,7 +165,7 @@ class FrameSetSpellChecker : public content::RenderFrameVisitor {
|
|||
DISALLOW_COPY_AND_ASSIGN(FrameSetSpellChecker);
|
||||
};
|
||||
|
||||
class SpellCheckerHolder : public content::RenderFrameObserver {
|
||||
class SpellCheckerHolder final : public content::RenderFrameObserver {
|
||||
public:
|
||||
// Find existing holder for the |render_frame|.
|
||||
static SpellCheckerHolder* FromRenderFrame(
|
||||
|
|
|
@ -43,9 +43,9 @@ void TrimStringVectorForIPC(std::vector<base::string16>* strings) {
|
|||
strings->resize(kMaxListSize);
|
||||
|
||||
// Limit the size of the strings in the vector.
|
||||
for (size_t i = 0; i < strings->size(); ++i) {
|
||||
if ((*strings)[i].length() > kMaxDataLength)
|
||||
(*strings)[i].resize(kMaxDataLength);
|
||||
for (auto& str : *strings) {
|
||||
if (str.length() > kMaxDataLength)
|
||||
str.resize(kMaxDataLength);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue