File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ use tui::{
2424} ;
2525use utils:: { ItemBatch , LogEntry } ;
2626
27- static SLICE_SIZE : usize = 1200 ;
27+ const SLICE_SIZE : usize = 1200 ;
28+ const ELEMENTS_PER_LINE : usize = 10 ;
29+
2830///
2931pub struct Revlog {
3032 selection : usize ,
@@ -174,8 +176,6 @@ impl Revlog {
174176 tags : Option < String > ,
175177 theme : & Theme ,
176178 ) {
177- const ELEMENTS_PER_LINE : usize = 10 ;
178-
179179 txt. reserve ( ELEMENTS_PER_LINE ) ;
180180
181181 let splitter_txt = Cow :: from ( " " ) ;
@@ -229,7 +229,7 @@ impl Revlog {
229229 fn get_text ( & self , height : usize ) -> Vec < Text > {
230230 let selection = self . relative_selection ( ) ;
231231
232- let mut txt = Vec :: with_capacity ( height) ;
232+ let mut txt = Vec :: with_capacity ( height * ELEMENTS_PER_LINE ) ;
233233
234234 for ( idx, e) in self
235235 . items
You can’t perform that action at this time.
0 commit comments