For example, I’m considering the rewriting

```
fn eq<T: Eq>(a: &[T], b:[T]) -> bool {
if a.len() != b.len() {
return false;
}
// element-wise comparison
}
```

to

```
fn eq<T: Eq>(a: &[T], b:[T]) -> bool {
if a.len() != b.len() {
return false;
}
elem_wise_cmp(a, b)
}
fn elem_wise_cmp<T: Eq>(a: &[T], b: &[T]) -> T {
// element-wise comparison
}
```

I expect that `eq`

is inlined and `elem_wise_cmp`

isn’t inlined so we can avoid function call cost if `len`

s aren’t equal and can reduce code size explosion by inlining.

If the calculation of the condition of the early return is enough small, early return is enough likely to happen and the calculation of the split part is enough big, is this optimization effective? (edited)

If so, the above example effective?