mirror of
https://github.com/extrawurst/gitui.git
synced 2024-12-03 15:23:09 +03:00
fix capacity
This commit is contained in:
parent
7e9c988f50
commit
60d512a5b3
@ -24,7 +24,7 @@ use tui::{
|
|||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
|
|
||||||
const ELEMENTS_PER_LINE: usize = 10;
|
const ELEMENTS_PER_LINE: usize = 9;
|
||||||
|
|
||||||
///
|
///
|
||||||
pub struct CommitList {
|
pub struct CommitList {
|
||||||
@ -235,8 +235,7 @@ impl CommitList {
|
|||||||
now: DateTime<Local>,
|
now: DateTime<Local>,
|
||||||
marked: Option<bool>,
|
marked: Option<bool>,
|
||||||
) -> Spans<'a> {
|
) -> Spans<'a> {
|
||||||
let mut txt: Vec<Span> = Vec::new();
|
let mut txt: Vec<Span> = Vec::with_capacity(
|
||||||
txt.reserve(
|
|
||||||
ELEMENTS_PER_LINE + if marked.is_some() { 2 } else { 0 },
|
ELEMENTS_PER_LINE + if marked.is_some() { 2 } else { 0 },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user