Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] json: fix assert typo in json_path_cmp()
@ 2019-11-11 15:06 Nikita Pettik
  2019-11-12 10:05 ` Kirill Yukhin
  0 siblings, 1 reply; 3+ messages in thread
From: Nikita Pettik @ 2019-11-11 15:06 UTC (permalink / raw)
  To: tarantool-patches

   284  int
   285  json_path_cmp(const char *a, int a_len, const char *b, int b_len,
   286                int index_base)
   287  {

  ...

   304          /* Paths a and b must be valid. */
   305          assert(rc_b == 0 && rc_b == 0);

Obviously (according to the comment) author implied that both rc_a == 0
and rc_b == 0. Let's fix this small typo.
---
Branch: https://github.com/tarantool/tarantool/tree/np/json-assert-typo

 src/lib/json/json.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/json/json.c b/src/lib/json/json.c
index 1bfef172a..ffac2c2b5 100644
--- a/src/lib/json/json.c
+++ b/src/lib/json/json.c
@@ -302,7 +302,7 @@ json_path_cmp(const char *a, int a_len, const char *b, int b_len,
 			return rc;
 	}
 	/* Paths a and b must be valid. */
-	assert(rc_b == 0 && rc_b == 0);
+	assert(rc_a == 0 && rc_b == 0);
 	/*
 	 * The parser stopped because the end of one of the paths
 	 * was reached. As JSON_TOKEN_END > JSON_TOKEN_{NUM, STR},
-- 
2.15.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Tarantool-patches] [PATCH] json: fix assert typo in json_path_cmp()
  2019-11-11 15:06 [Tarantool-patches] [PATCH] json: fix assert typo in json_path_cmp() Nikita Pettik
@ 2019-11-12 10:05 ` Kirill Yukhin
  2019-11-12 12:43   ` Nikita Pettik
  0 siblings, 1 reply; 3+ messages in thread
From: Kirill Yukhin @ 2019-11-12 10:05 UTC (permalink / raw)
  To: Nikita Pettik; +Cc: tarantool-patches

Hello,

On 11 ноя 18:06, Nikita Pettik wrote:
>    284  int
>    285  json_path_cmp(const char *a, int a_len, const char *b, int b_len,
>    286                int index_base)
>    287  {
> 
>   ...
> 
>    304          /* Paths a and b must be valid. */
>    305          assert(rc_b == 0 && rc_b == 0);
> 
> Obviously (according to the comment) author implied that both rc_a == 0
> and rc_b == 0. Let's fix this small typo.

Just check it in as obvious.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Tarantool-patches] [PATCH] json: fix assert typo in json_path_cmp()
  2019-11-12 10:05 ` Kirill Yukhin
@ 2019-11-12 12:43   ` Nikita Pettik
  0 siblings, 0 replies; 3+ messages in thread
From: Nikita Pettik @ 2019-11-12 12:43 UTC (permalink / raw)
  To: Kirill Yukhin; +Cc: tarantool-patches

On 12 Nov 13:05, Kirill Yukhin wrote:
> Hello,
> 
> On 11 ноя 18:06, Nikita Pettik wrote:
> >    284  int
> >    285  json_path_cmp(const char *a, int a_len, const char *b, int b_len,
> >    286                int index_base)
> >    287  {
> > 
> >   ...
> > 
> >    304          /* Paths a and b must be valid. */
> >    305          assert(rc_b == 0 && rc_b == 0);
> > 
> > Obviously (according to the comment) author implied that both rc_a == 0
> > and rc_b == 0. Let's fix this small typo.
> 
> Just check it in as obvious.

Ok, pushed to master.
 
> --
> Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-12 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-11 15:06 [Tarantool-patches] [PATCH] json: fix assert typo in json_path_cmp() Nikita Pettik
2019-11-12 10:05 ` Kirill Yukhin
2019-11-12 12:43   ` Nikita Pettik

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