Minor code clean: Mark const what is const, and use isEmpty.

Change-Id: I00f42d69f9c04ff0ea8a38ace8de9ea9ab174377
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>