|
From: | Bruce Stephens |
Subject: | [Monotone-devel] Re: using empty() instead of size() |
Date: | Tue, 23 Sep 2008 10:55:02 +0100 |
User-agent: | Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
"Derek Scherger" <address@hidden> writes: > Even if size does have to traverse a list to count the elements one would > expect that traversing an *empty* list should be reasonably quick. Sure, but presumably the extra cost is traversing a non-empty list to find that it's not empty. One would hope that an inlined size() together with a good optimizing compiler might be able to avoid the cost, but perhaps that's not feasible.
[Prev in Thread] | Current Thread | [Next in Thread] |