VirtualBox

Changeset 107454 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Jan 7, 2025 10:16:43 AM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166509
Message:

Runtime/common/misc/uri.cpp: Don't call strlen() two times in the RT_MIN() expansion to save some time (maybe the compiler would optimize this but better not depend on it), bugref:3409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/uri.cpp

    r106061 r107454  
    102102    int rc = VINF_SUCCESS;
    103103
    104     size_t cbLen = RT_MIN(strlen(pszString), cchMax);
     104    size_t const cchStr = strlen(pszString);
     105    size_t cbLen = RT_MIN(cchStr, cchMax);
    105106    /* The new string can be max 3 times in size of the original string. */
    106107    char *pszNew = RTStrAlloc(cbLen * 3 + 1);
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