VirtualBox

Changeset 38181 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jul 26, 2011 12:31:09 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73139
Message:

Main/Progress: optimize forwarding of the progress percentage when nothing changed by avoiding redundant calls which only make the time estimation worse

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r37069 r38181  
    931931    BOOL fCompleted      = FALSE;
    932932    BOOL fCanceled       = FALSE;
     933    ULONG prevPercent    = UINT32_MAX;
    933934    ULONG currentPercent = 0;
    934935    ULONG cOp            = 0;
     
    977978                    if (FAILED(rc)) return rc;
    978979                    ++cOp;
    979                 }else
     980                }
     981                else
    980982                    break;
    981983            }
     
    983985            rc = pProgressAsync->COMGETTER(OperationPercent(&currentPercent));
    984986            if (FAILED(rc)) return rc;
    985             rc = SetCurrentOperationProgress(currentPercent);
    986             if (FAILED(rc)) return rc;
     987            if (currentPercent != prevPercent)
     988            {
     989                prevPercent = currentPercent;
     990                rc = SetCurrentOperationProgress(currentPercent);
     991                if (FAILED(rc)) return rc;
     992            }
    987993        }
    988994        if (fCompleted)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette