Change in ovirt-engine[master]: webamdin: SanStorageModelBase removeIf usage

Code Review gerrit at ovirt.org
Thu Apr 6 02:43:24 UTC 2017


>From Allon Mureinik <amureini at redhat.com>:

Allon Mureinik has submitted this change and it was merged.

Change subject: webamdin: SanStorageModelBase removeIf usage
......................................................................


webamdin: SanStorageModelBase removeIf usage

In order to remove items from lists, SanStorageModelBase used to copy
them (using Linq#toList), iterate over the new lists and remove items
from the original ones. This meant iterating each list twice instead
of just once.

This patch improves this model's performance by using Java 8's
Collection#removeIf method, allowing to iterate over the list only
once and remove items from it on the fly.

Change-Id: I8242cba242e0310fb58cedd7cc559a657d0580e7
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/storage/SanStorageModelBase.java
1 file changed, 4 insertions(+), 14 deletions(-)

Approvals:
  Tal Nisan: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Allon Mureinik: Verified
  Idan Shaby: Looks good to me, but someone else must approve



-- 
To view, visit https://gerrit.ovirt.org/75159
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8242cba242e0310fb58cedd7cc559a657d0580e7
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list