<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 28, 2014 at 1:23 PM, Paul Eggleton <span dir="ltr">&lt;<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@linux.intel.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Saturday 26 April 2014 16:32:18 Jacob Kroon wrote:<br>
&gt; Cleanup the fix done in f9416e76e272ba3249abff099f6f3a47fe82e03e.<br>
&gt;<br>
&gt; Instead of adding continue statements we can just move the last<br>
&gt; statements into the final else-clause.<br>
&gt;<br>
&gt; Signed-off-by: Jacob Kroon &lt;<a href="mailto:jacob.kroon@mikrodidakt.se">jacob.kroon@mikrodidakt.se</a>&gt;<br>
&gt; ---<br>
&gt;  lib/bb/fetch2/__init__.py | 7 ++-----<br>
&gt;  1 file changed, 2 insertions(+), 5 deletions(-)<br>
&gt;<br>
&gt; diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py<br>
&gt; index 5a03a0e..bc4e8fd 100644<br>
&gt; --- a/lib/bb/fetch2/__init__.py<br>
&gt; +++ b/lib/bb/fetch2/__init__.py<br>
&gt; @@ -985,15 +985,12 @@ def get_file_checksums(filelist, pn):<br>
&gt;                      checksum = checksum_file(f)<br>
&gt;                      if checksum:<br>
&gt;                          checksums.append((f, checksum))<br>
<br>
</div>Note the above, then see below.<br>
<div class=""><br>
&gt; -            continue<br>
&gt;          elif os.path.isdir(pth):<br>
&gt;              checksums.extend(checksum_dir(pth))<br>
&gt; -            continue<br>
&gt;          else:<br>
&gt;              checksum = checksum_file(pth)<br>
&gt; -<br>
&gt; -        if checksum:<br>
&gt; -            checksums.append((pth, checksum))<br>
&gt; +            if checksum:<br>
&gt; +                checksums.append((pth, checksum))<br>
&gt;<br>
&gt;      checksums.sort(key=operator.itemgetter(1))<br>
&gt;      return checksums<br>
<br>
</div>This cleanup seems innocuous but unfortunately it does cause a change in<br>
behaviour - now for the glob case we will get the last item duplicated because<br>
it will be added to the list a second time at the end.<br>
<br></blockquote><br></div><div class="gmail_quote">Sorry..<br>But I can&#39;t see why this would cause a different behaviour. Both previous &#39;continue&#39; statements applied to the outer for-loop. Unless they have an effect on the if-statements aswell ?<br>
</div></div></div>