Skip to content

Instantly share code, notes, and snippets.

View hyunsik's full-sized avatar
🏠
Working from home

Hyunsik Choi hyunsik

🏠
Working from home
View GitHub Profile
@hyunsik
hyunsik / playground.rs
Created July 24, 2015 13:03 — forked from anonymous/playground.rs
Shared via Rust Playground
fn filter<T>(res: &mut [usize], lhs: &[T], rhs: &[T])
where T : Copy + PartialOrd {
let mut matched: usize = 0;
for x in 0..lhs.len() {
res[matched] = x;
matched = matched + if lhs[x] > rhs[x] { 1 } else { 0 };
}
}