Skip to content

Commit

Permalink
Fix last column being empty during asrw/urw benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov authored May 6, 2020
1 parent 87b008c commit 8470727
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ pub fn alt_screen_random_write<W: Write>(ctx: &mut Context<W>, options: &Options
ctx.smcup()?;

while written < options.bytes {
let (l, c) = (rng.gen_range(0, h), rng.gen_range(0, w - 1));
let (l, c) = (rng.gen_range(0, h), rng.gen_range(0, w));
let space = w - c;
let to_write = rng.gen_range(0, space);
let to_write = rng.gen_range(0, space) + 1;

written += ctx.cup(l, c)?;
if options.colorize {
Expand Down Expand Up @@ -129,7 +129,7 @@ pub fn unicode_random_write<W: Write>(ctx: &mut Context<W>, options: &Options) -
let w = options.width;

while written < options.bytes {
let (l, c) = (rng.gen_range(0, h), rng.gen_range(0, w - 1));
let (l, c) = (rng.gen_range(0, h), rng.gen_range(0, w));

written += ctx.cup(l, c)?;
if options.colorize {
Expand Down

0 comments on commit 8470727

Please sign in to comment.