prefer repeat_n() over repeat().take()
This commit is contained in:
@@ -878,7 +878,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
|
||||
.compute_size_in_bytes(layout.size, count)
|
||||
.ok_or_else(|| err_ub_custom!(fluent::const_eval_size_overflow, name = name))?;
|
||||
|
||||
let bytes = std::iter::repeat(byte).take(len.bytes_usize());
|
||||
let bytes = std::iter::repeat_n(byte, len.bytes_usize());
|
||||
self.write_bytes_ptr(dst, bytes)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user