[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fileio.c: introduce make_temp_name_buf
From: |
Alan Third |
Subject: |
Re: [PATCH] fileio.c: introduce make_temp_name_buf |
Date: |
Sun, 24 Jul 2016 20:28:19 +0100 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Jul 20, 2016 at 06:44:00PM +0600, Alexander Kuleshov wrote:
> Hello,
>
> The make_temp_name function in a case when BASE64_P is true or when
> HAVE_LONG_FILE_NAMES is not defined builds buffer where first three
> characters is a PID in base64 encoding. This leads to some of code
> duplication.
I was looking over it and thought the same thing.
> Attached patch introduces make_temp_name_buf() function which will
> do this functionality and allows to avoid code duplication.
This looks OK to me.
I think it would make more sense to only check for base64_p when
HAVE_LONG_FILE_NAMES is defined, though. If it’s not defined, it’s
currently checking it then executing identical code whatever the
outcome.
Once that’s done we’re only duplicating the code once and I don’t know
if it’s worth introducing a new function for that.
--
Alan Third