lapce icon indicating copy to clipboard operation
lapce copied to clipboard

Simplifying `lapce_ui::settings::ThemeSection::new`

Open JustForFun88 opened this issue 3 years ago • 1 comments

This pull request simplifies the lapce_ui::settings::ThemeSection::new function by removing the allocation of two intermediate vectors (one for Vec<&str>, the second inside Itertools::sorted method).

Also, since the colors are just Strings and it's not important to preserve their order, the Vec::sort_unstable method is now used instead of the Vec::sort method (inside Itertools::sorted method), since this method is usually faster and does not require any additional allocations.

JustForFun88 avatar Jan 03 '23 11:01 JustForFun88

Codecov Report

Merging #1917 (75c77a9) into master (97d626d) will decrease coverage by 0.00%. The diff coverage is 0.00%.

@@            Coverage Diff            @@
##           master   #1917      +/-   ##
=========================================
- Coverage    8.49%   8.49%   -0.01%     
=========================================
  Files         130     130              
  Lines       56586   56578       -8     
=========================================
- Hits         4805    4804       -1     
+ Misses      51781   51774       -7     
Impacted Files Coverage Δ
lapce-ui/src/settings.rs 0.00% <0.00%> (ø)
lapce-data/src/keypress/keypress.rs 73.02% <0.00%> (-0.21%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Jan 03 '23 12:01 codecov-commenter