Lior Vernia has posted comments on this change.

Change subject: webadmin: Vm dialog- bugs with nic naming
......................................................................


Patch Set 4: Code-Review+2

(1 comment)

http://gerrit.ovirt.org/#/c/28599/4/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfilesInstanceTypeEditor.java
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/profile/ProfilesInstanceTypeEditor.java:

Line 25: 
Line 26:     private String elementId = DOM.createUniqueId();
Line 27: 
Line 28:     private Collection<VnicProfileView> vnicProfiles;
Line 29:     private final List<VmNetworkInterface> vnics;
Consider using a Map<String, VmNetworkInterface>, which will map from the vNIC 
names (not supposed to be modified) to the actual vNIC, and pass Map.values() 
to the AsyncDataProvider method.

It's more efficient (obviously in looking up a vNIC to remove it, and as far as 
I could see Map.values() also runs in O(1) time), and I think it's also the 
more fitting data structure for the need here.

I won't put my foot down because I don't think the impact here is big, but I 
think it's better design-wise.
Line 30: 
Line 31:     public ProfilesInstanceTypeEditor() {
Line 32:         vnics = new ArrayList<VmNetworkInterface>();
Line 33:         initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this));


-- 
To view, visit http://gerrit.ovirt.org/28599
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib8594a29ba9c8ed32e4a0d4f8df78212dfc9f40f
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to