Simplify `std::fill` with `std::fill_n`

This commit is contained in:
mitaclaw 2024-08-22 19:24:49 -07:00
parent 7c96762f5f
commit b6ec8ddc20
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}