Re: [PATCH v7 2/5] setup: sanity check file size in read_gitfile_gently
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 15, 2015, 03:08 UTC
- Message-ID
- <CAPig+cRouQOgd29qQZSUo0t+NBPfeKWD+4j42pArLW3TpND=bQ@mail.gmail.com>
- In-Reply-To
- <CAMpP7NZ2tqZ5cv=9=gJqDZ5m0LOZtsHGvt-ntZcp6cBA6X5tqg@mail.gmail.com>
On Sun, Jun 14, 2015 at 1:21 PM, erik elfström <erik.elfstrom@gmail.com> wrote:
Show 11 quoted lines
> On Sun, Jun 14, 2015 at 5:42 AM, Eric Sunshine <sunshine@sunshineco.com> wrote: >> >> This variable name doesn't convey much about its purpose, and >> introduces a bit of maintenance burden if the limit is some day >> changed. Perhaps "sane_size_limit" or something even more descriptive >> (and/or terse) would be better. > > Would you be happy with this change? > > - static const int one_MB = 1 << 20; > + static const int max_file_size = 1 << 20; /* 1MB */
Yep, that's a much nicer variable name. Thanks.
I also note that 'const int' shows up pretty frequently in the git source code, but 'static const int' is used only very rarely.