All of lore.kernel.org
 help / color / mirror / Atom feed
* Unreachable code in builtin-merge.c ?
@ 2009-10-23 15:03 Zivkov, Sasa
  2009-10-23 15:12 ` Mikael Magnusson
  2009-10-23 15:14 ` Joshua Roys
  0 siblings, 2 replies; 4+ messages in thread
From: Zivkov, Sasa @ 2009-10-23 15:03 UTC (permalink / raw)
  To: git@vger.kernel.org

In the try_merge_strategy function the expression in the following if statement seems to always evaluate to TRUE:

        if (!strcmp(strategy, "recursive") || !strcmp(strategy, "subtree")) {

If strategy is "recursive" then !strcmp(strategy, "subtree") evaluates to TRUE.
If strategy is "subtree" then !strcmp(strategy, "recursive") evaluates to TRUE.
If strategy is neither "recursive" nor "subtree" then any side of || evaluates to TRUE.

Looks like the code in the else block is unreachable?


Saša Živkov

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

end of thread, other threads:[~2009-10-23 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23 15:03 Unreachable code in builtin-merge.c ? Zivkov, Sasa
2009-10-23 15:12 ` Mikael Magnusson
2009-10-23 15:14 ` Joshua Roys
2009-10-23 15:39   ` Zivkov, Sasa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.