>>>>> On Sat, 02 Jul 2005 14:17:55 -0600 (MDT), Adam Winer <ADAM.WINER_at_oracle.com> said:
AW> Jacob,
AW> Great to see some optimizing of this code - getFacetsAndChildren()
AW> is desperately in need of it - but the new getFacetCount()
AW> API's got to be brought over to the EG. Where I'll +1 it.
AW> Also, you could optimize getFacetsAndChildren() further
AW> to deal with the common scenarios of children but no
AW> facets or facets but no children:
AW> if (getFacetCount() == 0) {
AW> if (getChildCount() == 0) { return EMPTY_ITERATOR };
AW> return getChildren().iterator();
AW> }
AW> else if (getChildCount() == 0) {
AW> return getFacets().values().iterator();
AW> }
AW> else {
AW> ... old code ...
AW> }
AW> ...saving a whopping one object allocation, but it does
AW> add up with all the tree walking we do.
I've checked this in.
Ed
--
| ed.burns_at_sun.com | {home: 407 869 9587, office: 408 884 9519 OR x31640}
| homepage: | http://purl.oclc.org/NET/edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com