> +                    .compare(getSpace(h1), getSpace(h2))
> +                    .compare(getBootableDeviceType(h1), 
> getBootableDeviceType(h2));
> +            if(!volumes1.isEmpty() && !volumes2.isEmpty() && volumes1.size() 
> == volumes2.size()) {
> +               for (int i = 0; i < volumes1.size(); i++) {
> +                  comparisonChain.compare(volumes1.get(i).getType(), 
> volumes2.get(i).getType());
> +               }
> +            }
> +            return comparisonChain.result();
> +         }
> +      });
> +      for (VirtualGuestBlockDevice blockDevice : 
> virtualGuestConfiguration.getVirtualGuestBlockDevices()) {
> +         if (blockDevice.getDevice().equals(BOOTABLE_DEVICE)) {
> +            for (Integer cpus : 
> virtualGuestConfiguration.getCpusOfProcessors()) {
> +               for (Integer memory : 
> virtualGuestConfiguration.getMemories()) {
> +                  float capacity = 
> blockDevice.getVirtualDiskImage().getCapacity();
> +                  Type type = 
> blockDevice.getVirtualGuest().isLocalDiskFlag() ? Type.LOCAL : Type.SAN;

Move these two lines outside the for loops to compute them only once.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/296/files#r12882384

Reply via email to