Replace unneeded empty() calls

Bug: T78451
Change-Id: I08fbdceaa536125324e67bba6f66fa826a2b5547