Use empty() instead of size() == 0.