VirtualBox

Changeset 39873 in vbox


Ignore:
Timestamp:
Jan 25, 2012 11:49:04 AM (13 years ago)
Author:
vboxsync
Message:

RTCString::find: made it more readable - 2 variable assignments in one if isn't cool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/ministring.cpp

    r39277 r39873  
    202202size_t RTCString::find(const char *pcszFind, size_t pos /*= 0*/) const
    203203{
    204     const char *pszThis, *p;
    205 
    206     if (    ((pszThis = c_str()))
    207          && (pos < length())
    208          && ((p = strstr(pszThis + pos, pcszFind)))
    209        )
    210         return p - pszThis;
     204    if (pos < length())
     205    {
     206        const char *pszThis = c_str();
     207        if (pszThis)
     208        {
     209            const char *pszHit = strstr(pszThis, pcszFind);
     210            if (pszHit)
     211                return pszHit - pszThis;
     212        }
     213    }
    211214
    212215    return npos;
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