Re: [HACKERS] Compiler warning in costsize.c

Поиск
Список
Период
Сортировка
От ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Тема Re: [HACKERS] Compiler warning in costsize.c
Дата
Msg-id d8j60icrxh6.fsf@dalvik.ping.uio.no
обсуждение исходный текст
Ответ на Re: [HACKERS] Compiler warning in costsize.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Compiler warning in costsize.c
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> I wonder if we shouldn't just do
>
>      RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
>      ListCell   *lc;
>  
>      /* Should only be applied to base relations that are subqueries */
>      Assert(rel->relid > 0);
> -#ifdef USE_ASSERT_CHECKING
>      rte = planner_rt_fetch(rel->relid, root);
>      Assert(rte->rtekind == RTE_SUBQUERY);
> -#endif
>
> and eat the "useless" calculation of rte.

Why bother with the 'rte' variable at all if it's only used for the
Assert()ing the rtekind?
   Assert(planner_rt_fetch(rel->relid, root)->rtekind == RTE_SUBQUERY);

- ilmari

-- 
"The surreality of the universe tends towards a maximum" -- Skud's Law
"Never formulate a law or axiom that you're not prepared to live withthe consequences of."
--Skud's Meta-Law
 



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stas Kelvich
Дата:
Сообщение: Re: [HACKERS] logical replication worker and statistics
Следующее
От: Fujii Masao
Дата:
Сообщение: [HACKERS] tablesync patch broke the assumption that logical rep depends on?