Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org,
	Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [tarantool-patches] Re: [PATCH v1 1/1] Implement mp_stack_top for mp_stack class
Date: Wed, 3 Apr 2019 18:16:25 +0300	[thread overview]
Message-ID: <4377f916-eb85-44c4-2124-cb4b14d5a6d4@tarantool.org> (raw)
In-Reply-To: <20190403121202.w66dbmhr7yrr5ysd@esperanza>

> or something like that. BTW, if you agree, let's also rename 'curr' to
> 'idx' or 'index' - 'curr' looks kinda ugly and since now we are going to
> access it directly, we'd better rename it IMO.
> 
> What do you think?

I am not shure that it is good concept. Consider a part of MP_PRINT macro

	while (!mp_stack_is_empty(&stack)) {
		struct mp_frame *frame = mp_stack_top(&stack);
		enum mp_type type = frame->type;
		bool stop = !mp_frame_advance(frame);
		if (frame->idx == 0 || frame->count == 0)
			PRINTF(type == MP_ARRAY ? "[" : "{");
		if (stop) {
			PRINTF(type == MP_ARRAY ? "]" : "}");
			mp_stack_pop(&stack);
			continue;
		} else if (frame->idx != 0) {
			PRINTF(type == MP_MAP && frame->idx % 2 == 1 ? ": " : ", ");
		}
		goto next;
	}

To my opinion, the code got worse.

  reply	other threads:[~2019-04-03 15:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02 15:49 Kirill Shcherbatov
2019-04-03 12:12 ` Vladimir Davydov
2019-04-03 15:16   ` Kirill Shcherbatov [this message]
2019-04-03 15:40     ` [tarantool-patches] " Vladimir Davydov
2019-04-03 17:49       ` Kirill Shcherbatov
2019-04-04 15:42         ` Vladimir Davydov
2019-04-05 17:17           ` Kirill Shcherbatov
2019-04-07 12:02             ` Vladimir Davydov

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=4377f916-eb85-44c4-2124-cb4b14d5a6d4@tarantool.org \
    --to=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [tarantool-patches] Re: [PATCH v1 1/1] Implement mp_stack_top for mp_stack class' \
    /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