mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
is_wsl(): Move .copied() earlier in the iter pipeline
This is a best practice that usually helps with auto vectorization, as llvm has a hard time seeing through the references.
This commit is contained in:
parent
5dcc5955fb
commit
059b842d1b
1 changed files with 2 additions and 2 deletions
|
@ -1719,10 +1719,10 @@ pub fn is_windows_subsystem_for_linux() -> bool {
|
||||||
|
|
||||||
let release: Vec<_> = release
|
let release: Vec<_> = release
|
||||||
.iter()
|
.iter()
|
||||||
.skip_while(|c| **c != b'-')
|
.copied()
|
||||||
|
.skip_while(|c| *c != b'-')
|
||||||
.skip(1) // the dash itself
|
.skip(1) // the dash itself
|
||||||
.take_while(|c| c.is_ascii_digit())
|
.take_while(|c| c.is_ascii_digit())
|
||||||
.copied()
|
|
||||||
.collect();
|
.collect();
|
||||||
let build: Result<u32, _> = std::str::from_utf8(&release).unwrap().parse();
|
let build: Result<u32, _> = std::str::from_utf8(&release).unwrap().parse();
|
||||||
match build {
|
match build {
|
||||||
|
|
Loading…
Reference in a new issue