]> source.dussan.org Git - vaadin-framework.git/commit
Improve performance of Util.collectionEquals (#16968).
authorFabian Lange <lange.fabian@gmail.com>
Mon, 2 Mar 2015 11:16:19 +0000 (12:16 +0100)
committerVaadin Code Review <review@vaadin.com>
Mon, 2 Mar 2015 13:44:28 +0000 (13:44 +0000)
commitcc8829ccf3a2acd6919dfb7c7afd2385daaa11a0
treeba03ca0edc21b09dc46695fc990b30eb4afdda5f
parent3397a649b5a0b39df322b92dab50dd256e3fcaac
Improve performance of Util.collectionEquals (#16968).

This change checks the length of both collections first before iterating
them. This massively speeds up the comparison in case the collections do
not have the same length.

Also in the case where the lengths are equal, this saves the
collection2.hasNext() checks.

Change-Id: If1325f3581d12bf742d77fbf8b0f89511fa11252
client/src/com/vaadin/client/Util.java