[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu-arch-users] star-merge implementation question

From: David Allouche
Subject: [Gnu-arch-users] star-merge implementation question
Date: Sun, 19 Sep 2004 17:56:35 +0200

In star-merge.c at line 86, I read the following:

  for (x = 0; !highest_common_to_revision && (x < rel_n_records 
(from_merges_from_to)); ++x)
      if (arch_tree_has_log (to_tree_root, to_archive, 
          highest_common_to_revision = str_save (0, from_merges_from_to[0][1]);
          from_rev_of_highest_common_to_revision = str_alloc_cat_many (0, 
from_version, "--", from_merges_from_to[0][0], str_end);

This for loop completely puzzles me. The body of the loop looks like it
should execute exactly in the same way every time.

If rel_n_records (from_merges_from_to) == 0, the loop is not executed.
Elif arch_tree_has_log (to_tree_root, to_archive, from_merges_from_to[0][1],
    the loop is executed exactly once.
Else the loop is executed until x == rel_n_records (from_merges_from_to).

In any case, there does not seem to be any point in having a loop
instead of a conditional.

What am I misunderstanding?

                                                            -- ddaa

reply via email to

[Prev in Thread] Current Thread [Next in Thread]