Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ollydbg on April 09, 2013, 09:57:57 AM

Title: Code format question: do we need to indent the while block?
Post by: ollydbg on April 09, 2013, 09:57:57 AM

    if (buffer.find(_T("$if")) != wxString::npos)
    while (m_RE_If.Matches(buffer))
    {
        search = m_RE_If.GetMatch(buffer, 0);
        replace = EvalCondition(m_RE_If.GetMatch(buffer, 1), m_RE_If.GetMatch(buffer, 3), m_RE_If.GetMatch(buffer, 5), target);
        buffer.Replace(search, replace, false);
    }

should be:

    if (buffer.find(_T("$if")) != wxString::npos)
        while (m_RE_If.Matches(buffer))
        {
            search = m_RE_If.GetMatch(buffer, 0);
            replace = EvalCondition(m_RE_If.GetMatch(buffer, 1), m_RE_If.GetMatch(buffer, 3), m_RE_If.GetMatch(buffer, 5), target);
            buffer.Replace(search, replace, false);
        }

Title: Re: Code format question: do we need to indent the while block?
Post by: oBFusCATed on April 09, 2013, 10:02:03 AM
Yes, of course :)
Title: Re: Code format question: do we need to indent the while block?
Post by: Folco on April 09, 2013, 02:57:30 PM
Same as obfuscated ! :)
Title: Re: Code format question: do we need to indent the while block?
Post by: ollydbg on April 09, 2013, 03:08:40 PM
Fix in trunk At revision: 8975. Thanks all.
Title: Re: Code format question: do we need to indent the while block?
Post by: Folco on April 09, 2013, 03:16:47 PM
Thank you !