[Tarantool-patches] [PATCH 3/5] qsync: txn_commit_async -- drop redundant variable
Cyrill Gorcunov
gorcunov at gmail.com
Sat Jul 11 00:36:01 MSK 2020
On Fri, Jul 10, 2020 at 11:28:26PM +0200, Vladislav Shpilevoy wrote:
> On 10/07/2020 23:10, Cyrill Gorcunov wrote:
> > On Fri, Jul 10, 2020 at 10:35:50PM +0200, Vladislav Shpilevoy wrote:
> >> Опять же. Патч технически корректен, но так же и бесполезен.
> >> Его полезность сравнима с исправлением опечатки в каком-нибудь
> >> не особо нужном комменте. Сори, если токсично звучит.
> >>
> >> Но не вижу в этом патче нужды.
> >
> > We've to allocate a variable which we simply don't need. Look,
> > the former code reads the flag, puts it into variable then
> > immediately read it and that's all :/ I think we should not
> > spread @is_sync but read the flag as much as possible for
> > better grep'ability.
>
> Do you have a proof that this change improves anything? That
> the variable 'allocation' on the stack actually happens, and
> costs even 1 ns?
You simply don't need it. I think the compiler will rip it off.
Again, if you suspect that the code gonna be changed then ignoring
the commit is perfectly fine. If not -- the useless variable is just
a bad taste at minimum.
More information about the Tarantool-patches
mailing list