On 09/20/11 06:16 AM, Ebenezer wrote:
> On Sep 18, 11:43 pm, Ian Collins<ian-n...@hotmail.com> wrote:
>> On 09/19/11 01:25 PM, Ebenezer wrote:> On Sep 18, 4:34 pm, Ian Collins<ian-n...@hotmail.com> wrote:
>>>> On 09/19/11 08:30 AM, Ebenezer wrote:
>>>>> On Sep 15, 7:23 pm, Ebenezer<woodbria...@gmail.com> wrote:
>>
>>>>>> ending:
>>>>>> buf_.erase(buf_.begin(), buf_.begin() + numWritten);
>>>>>> if (numWritten == all) return true;
>>
>>>>>> partialFlush = true;
>>>>>> return false;
>>>>>> }
>>
>>>>> How would you rate this function -- with a 1 being terrible
>>>>> and a 10 being excellent?
>>
>>>> You don't appear to have headed any of the suggestions.
>>
>>> I'm not opposed to the size_t suggestion, but am wanting to
>>> focus on the bigger picture.
>>
>>>> At review, I'd still give it a 1 because it isn't clear what it does,
>>>> why it uses fixed width types and it still contains gratuitous gotos.
>>
>>> All of the code is free -- gratuitous. Meanwhile no one has
>>> provided an alternative they think is better.
>>
>> Everything at after your ending label could be in a bool returning
>> member function.
>>
>
> OK, so if I work on an implementation like that would you
> suggest making some of the local variables member variables?
> The added function needs to access numWritten, all and partialFlush.
Well you've already made partialFlush static, so it's a obvious
contender for a a member variable. The other two could be parameters.
--
Ian Collins
|