3 ms·
> Go will not inline a function that exceeds complexity metrics True, but: > and one of those metrics is whether the function contains a range statement. You
by felixge 5y ago
> Go will not inline a function that exceeds complexity metrics
True, but:
> and one of those metrics is whether the function contains a range statement. You will get a real heap-allocated closure invocation on each loop.
I think this is no longer true in Go 1.18, see https://github.com/golang/go/issues/14768#issuecomment-981759381 https://github.com/golang/go/issues/14768#issuecomment-98175... .