Skip to content

Commit

Permalink
More clang-tidy checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekazakov committed May 16, 2024
1 parent 27210ed commit 88c0cf1
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Source/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Checks: >
modernize-use-using,
performance-avoid-endl,
performance-enum-size,
performance-faster-string-find
performance-faster-string-find,
performance-for-range-copy
CheckOptions:
- key: modernize-loop-convert.MinConfidence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ - (instancetype)initWithEditorsStorage:(ExternalEditorsStorage &)_storage
m_ExternalEditorsStorage = &_storage;
auto v = m_ExternalEditorsStorage->AllExternalEditors();
m_Editors = [NSMutableArray new];
for( auto i : v ) {
for( const auto &i : v ) {
ExternalEditorInfo *ed = [ExternalEditorInfo new];
ed.name = [NSString stringWithUTF8StdString:i->Name()];
ed.path = [NSString stringWithUTF8StdString:i->Path()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
NSString *prefix = [NSString stringWithUTF8StdString:_prefix];
NSRange range = NSMakeRange(0, prefix.length);

for( auto i : _listing ) {
for( const auto &i : _listing ) {

if( !i.IsDir() )
continue;
Expand Down
2 changes: 1 addition & 1 deletion Source/Operations/source/FilenameTextControl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ - (void)updateTextView:(NSTextView *)_text_view withAutocompetion:(const std::st
const auto prefix = [NSString stringWithUTF8StdString:_prefix];
const auto range = NSMakeRange(0, prefix.length);

for( auto i : _listing ) {
for( const auto &i : _listing ) {

if( !i.IsDir() )
continue;
Expand Down
2 changes: 1 addition & 1 deletion Source/Operations/source/GenericErrorDialog.mm
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ - (void)placeButtons

NSButton *last = nil;
const auto content_view = self.window.contentView;
for( auto p : m_Buttons ) {
for( const auto &p : m_Buttons ) {
NSButton *button = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
button.translatesAutoresizingMaskIntoConstraints = false;
button.buttonType = NSButtonTypeMomentaryPushIn;
Expand Down
2 changes: 1 addition & 1 deletion Source/Operations/source/PoolViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ - (void)syncWithOperations:(const std::vector<std::shared_ptr<Operation>> &)_ope

std::vector<NCOpsBriefOperationViewController *> new_views;
new_views.reserve(_operations.size());
for( auto o : _operations )
for( const auto &o : _operations )
if( const auto existing = find_existing(o) ) {
new_views.emplace_back(existing);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Term/tests/ShellTask_IT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ TEST_CASE(PREFIX "ChDir(), verify via output and cwd prompt (Bash)")
const auto dir3 = dir.directory / "Blackmore's Night" / "";
const auto dir4 = dir.directory / U"Сектор Газа" / "";
const auto dir5 = dir.directory / U"😀🍻" / "";
for( auto d : {dir2, dir3, dir4, dir5} )
for( const auto &d : {dir2, dir3, dir4, dir5} )
std::filesystem::create_directory(d);

AtomicHolder<std::string> buffer_dump;
Expand Down
2 changes: 1 addition & 1 deletion Source/Utility/tests/DiskUtility_UT.mm
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
bool has_data = false;
bool has_system = false;

for( auto container_name : tree.ContainersNames() ) {
for( const auto &container_name : tree.ContainersNames() ) {
const auto data = tree.FindVolumesInContainerWithRole(container_name, APFSTree::Role::Data);
if( data && !data->empty() )
has_data = true;
Expand Down

0 comments on commit 88c0cf1

Please sign in to comment.