Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: JaySon-Huang <[email protected]>
  • Loading branch information
JaySon-Huang committed Apr 26, 2022
1 parent aaeab4c commit 9711b5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dbms/src/Storages/PathCapacityMetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ void PathCapacityMetrics::freeUsedSize(std::string_view file_path, size_t used_b
std::map<FSID, DiskCapacity> PathCapacityMetrics::getDiskStats()
{
std::map<FSID, DiskCapacity> disk_stats_map;
for (size_t i = 0; i < path_infos.size(); ++i)
for (auto & path_info : path_infos)
{
struct statvfs vfs;
FsStats path_stat;

std::tie(path_stat, vfs) = path_infos[i].getStats(log);
std::tie(path_stat, vfs) = path_info.getStats(log);
if (!path_stat.ok)
{
// Disk may be hot remove, Ignore this disk.
Expand Down Expand Up @@ -135,11 +135,11 @@ FsStats PathCapacityMetrics::getFsStats()
// which use to measure single disk capacity and available size
auto disk_stats_map = getDiskStats();

for (auto fs_it = disk_stats_map.begin(); fs_it != disk_stats_map.end(); ++fs_it)
for (auto & fs_it : disk_stats_map)
{
FsStats disk_stat{};

auto & disk_stat_vec = fs_it->second;
auto & disk_stat_vec = fs_it.second;
auto & vfs_info = disk_stat_vec.vfs_info;

for (const auto & single_path_stats : disk_stat_vec.path_stats)
Expand Down

0 comments on commit 9711b5a

Please sign in to comment.