VirtualBox

Ignore:
Timestamp:
Aug 3, 2016 2:16:14 PM (8 years ago)
Author:
vboxsync
Message:

Please use 'static const' on data that is constant, don't make the compiler recreated on the stack for each call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDPath.cpp

    r62816 r62919  
    3939#ifdef RT_OS_WINDOWS
    4040    RT_NOREF1(cbPath);
    41     /* Filter out characters not allowed on Windows platforms, put in by
    42        RTTimeSpecToString(). */
    43     /** @todo Use something like RTPathSanitize() when available. Later. */
    44     static const RTUNICP s_aCpSet[] =
     41    /* Replace out characters not allowed on Windows platforms, put in by RTTimeSpecToString(). */
     42    /** @todo Use something like RTPathSanitize() if available later some time. */
     43    static const RTUNICP s_uszValidRangePairs[] =
    4544    {
    46         ' ', ' ', '(', ')', '-', '.', '0', '9', 'A', 'Z', 'a', 'z', '_', '_',
    47         0xa0, 0xd7af, '\0'
     45        ' ', ' ',
     46        '(', ')',
     47        '-', '.',
     48        '0', '9',
     49        'A', 'Z',
     50        'a', 'z',
     51        '_', '_',
     52        0xa0, 0xd7af,
     53        '\0'
    4854    };
    49     ssize_t cReplaced = RTStrPurgeComplementSet(pszPath, s_aCpSet, '_' /* Replacement */);
     55    ssize_t cReplaced = RTStrPurgeComplementSet(pszPath, s_uszValidRangePairs, '_' /* chReplacement */);
    5056    if (cReplaced < 0)
    5157        rc = VERR_INVALID_UTF8_ENCODING;
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