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:
Mahmoud Al-Qudsi 2024-05-09 13:33:50 -05:00
parent 5dcc5955fb
commit 059b842d1b

View file

@ -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 {