From b6ec8ddc206ea8da474348e801758051d6470b79 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Thu, 22 Aug 2024 19:24:49 -0700 Subject: [PATCH] Simplify `std::fill` with `std::fill_n` --- Source/Core/DiscIO/Blob.cpp | 2 +- Source/DSPSpy/ConsoleHelper.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DiscIO/Blob.cpp b/Source/Core/DiscIO/Blob.cpp index 4d6b356473..6be4692879 100644 --- a/Source/Core/DiscIO/Blob.cpp +++ b/Source/Core/DiscIO/Blob.cpp @@ -203,7 +203,7 @@ u32 SectorReader::ReadChunk(u8* buffer, u64 chunk_num) { if (!GetBlock(block_num + i, buffer)) { - std::fill(buffer, buffer + (cnt_blocks - i) * m_block_size, 0u); + std::fill_n(buffer, (cnt_blocks - i) * m_block_size, 0u); return i; } buffer += m_block_size; diff --git a/Source/DSPSpy/ConsoleHelper.h b/Source/DSPSpy/ConsoleHelper.h index 791b94c636..90aea55f9f 100644 --- a/Source/DSPSpy/ConsoleHelper.h +++ b/Source/DSPSpy/ConsoleHelper.h @@ -60,7 +60,7 @@ inline void CON_BlankRow(const int y) int columns = 0, rows = 0; CON_GetMetrics(&columns, &rows); char blank[columns]; - std::fill(blank, blank + columns, ' '); + std::fill_n(blank, columns, ' '); blank[columns - 1] = '\0'; CON_Printf(0, y, "%s", blank); }