Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: Alex Khatskevich <avkhatskevich@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH] sql: fix decode analyze sample
Date: Fri, 1 Jun 2018 15:08:51 +0300	[thread overview]
Message-ID: <887A6F07-204B-4ECC-AB40-84390619CA24@tarantool.org> (raw)
In-Reply-To: <79583087-87c1-a36d-92c2-9daaf8be7772@tarantool.org>


> On 1 Jun 2018, at 14:41, Alex Khatskevich <avkhatskevich@tarantool.org> wrote:
> 
> Hi
>> Put here link to the branch on GitHub, and link to the issue.
> Branch: https://github.com/tarantool/tarantool/tree/kh/gh-2860-skip-scan
> Issue: https://github.com/tarantool/tarantool/issues/2860
>> I see that provided changes significantly refactor this function.
>> Would you mind to fix code style for whole function to make it
>> look like function from server?
> Done.

According to SOP conventions, you should attach diff of provided changes,
or send next version of patch. Otherwise, it is quite complicated to comment your fixes…

Firstly, lets move function’s comment to header and fix length:
comments should fit into 66 chars. Then, rename function to sql_stat4_column();
add struct prefixes to types which are really structs; don’t use Hungarian notation;
put comments above the code to be commented; don’t use beforehand declaration
for cycle counters (until it is really vital).

With these changes code would look more elegant

>> Lest just return 0 in case of success, and -1 otherwise.
> I do not like this approach.

Actually, it is not a suggestion: in server almost all functions obey this rule (AFAIK).
If function may fail due to different reasons, you can set error message explicitly.
For instance, on OOM: diag_set(OutOfMemory, …);

Except for these nitpickings, patch LGTM.

      parent reply	other threads:[~2018-06-01 12:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 13:47 [tarantool-patches] " AKhatskevich
2018-06-01  8:56 ` [tarantool-patches] " n.pettik
     [not found]   ` <79583087-87c1-a36d-92c2-9daaf8be7772@tarantool.org>
2018-06-01 12:08     ` n.pettik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=887A6F07-204B-4ECC-AB40-84390619CA24@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=avkhatskevich@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH] sql: fix decode analyze sample' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox