mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 07:35:43 +08: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
@ -1719,10 +1719,10 @@ pub fn is_windows_subsystem_for_linux() -> bool {
|
||||
|
||||
let release: Vec<_> = release
|
||||
.iter()
|
||||
.skip_while(|c| **c != b'-')
|
||||
.copied()
|
||||
.skip_while(|c| *c != b'-')
|
||||
.skip(1) // the dash itself
|
||||
.take_while(|c| c.is_ascii_digit())
|
||||
.copied()
|
||||
.collect();
|
||||
let build: Result<u32, _> = std::str::from_utf8(&release).unwrap().parse();
|
||||
match build {
|
||||
|
Loading…
x
Reference in New Issue
Block a user