|
From: | Markus Wanner |
Subject: | [Monotone-devel] using empty() instead of size() |
Date: | Mon, 22 Sep 2008 22:26:47 +0200 |
User-agent: | Mozilla-Thunderbird 2.0.0.16 (X11/20080724) |
Hi,in rev 805c482bc9bb80cd393be7d3ba01a65377d91d9c I've replaced lots of .size() == 0 (and similar) calls with .empty(). For one thing, I personally find it clearer and easier to read. And it's considered good practice because the implementation for most STL containers is simpler and faster.
I didn't notice any improvement with the commit benchmark, but the annotate one from nvm.cbench showed speedups between 4% and 15%.
Regards Markus Wanner (ne Schiltknecht)
[Prev in Thread] | Current Thread | [Next in Thread] |