VirtualBox

Changeset 95116 in vbox


Ignore:
Timestamp:
May 25, 2022 8:54:50 PM (3 years ago)
Author:
vboxsync
Message:

Main/USBDeviceFiltersImpl: Don't make an extra copy of the filter list, just use std:copy to do the job (c++17).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp

    r93115 r95116  
    299299    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    300300
    301     SafeIfaceArray<IUSBDeviceFilter> collection(*m->llDeviceFilters.data());
    302     aDeviceFilters.resize(collection.size());
    303     if (collection.size())
    304         for (size_t i = 0; i < collection.size(); ++i)
    305             aDeviceFilters[i] = collection[i];
     301    aDeviceFilters.resize(m->llDeviceFilters.data()->size());
     302    std::copy(m->llDeviceFilters.data()->begin(), m->llDeviceFilters.data()->end(), aDeviceFilters.begin());
    306303
    307304    return S_OK;
Note: See TracChangeset for help on using the changeset viewer.

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