Use lambda when appropriate

This is a safe refactoring that should have no behavior change in
terms of semantics and performance characteristics.

Test: make -j checkbuild
Change-Id: I30b40c483e490ff42c1c707233ca5cc7b67da28f
2 files changed