TreeItem and Tree have been checking indexes for bounds during indexed
access and traversal. Such checks are slow as node size computation is
an O(N) operation.
As Tree already does iteration when retrieving a TreeItem by its index,
and such iteration detects out-of-bounds problems, preliminary model
bounds check is redundant. Also, bounds check is avoidable during
iteration over a node - instead of an index, GTK iterator applies
directly.
Performance improvement proved by running
org.eclipse.swt.tests.junit.performance.Test_org_eclipse_swt_widgets_Tree.jfaceReveal().
In test jfaceReveal[Shape: STAR, virtual: true]:
10_000 elements: 501_378_662ns -> 218_583_468ns
100_000 elements: 52_781_899_817ns -> 20_872_245_796ns (-60%)