Optimize mirror layer management

We currently have to traverse the whole hierarchy twice to
update mirror layer info. While a long term rearchitecture may avoid
this entirely, we can optimize the hotpath by avoiding both traversals
when there are no mirror layers in existence.

Bug: 186200583
Test: Existing tests pass
Change-Id: I63f1fb239aa51e6db4fb1f4cb3cd3a87113d35d9
4 files changed