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
Code
    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:
Code
    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 !