On Wed, Nov 30, 2011 at 6:43 PM, Ryosuke Niwa <rn...@webkit.org> wrote:
> On Wed, Nov 30, 2011 at 6:26 PM, Ojan Vafai <o...@chromium.org> wrote: > >> On Wed, Nov 30, 2011 at 5:12 PM, Alexey Proskuryakov <a...@webkit.org>wrote: >> >>> >>> 30.11.2011, в 17:00, David Kilzer написал(а): >>> >>> - char* bufferStart = bufferPos; >>> + char* const bufferStart = bufferPos; >>> >>> >>> FWIW, working with code that parses strings is when I also always find >>> myself eager to use const local variables (pointers or indices). >>> >> >> I don't mind using const in some cases, but I share Darin's concern of >> littering the code with consts. I'd prefer that we come up with a fairly >> conservative guideline about when to use it. I'm not sure what that would >> look like. We could start with, what's special about this case, or string >> parsing in general that makes using const more valuable? >> > > I'd rather not have a precise rule and leave it to reviewers' discretion > because the usefulness of const local variable depends a lot on the > context. e.g. using local const is very helpful in a 1000-line function > whereas it's less useful in a 5-line function. > Yup. that's why I said "guideline" and not "rule". > > - Ryosuke > >
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev