[haiku-commits] Re: r40277 - haiku/trunk/src/system/kernel/vm

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 24 Jan 2011 08:56:39 +0100

Am 24.01.2011 00:12, schrieb anevilyak@xxxxxxxxx:
Author: anevilyak
Date: 2011-01-24 00:12:26 +0100 (Mon, 24 Jan 2011)
New Revision: 40277
Changeset: http://dev.haiku-os.org/changeset/40277

Modified:
    haiku/trunk/src/system/kernel/vm/vm.cpp
Log:
CID 10326 - remove superfluous for loop.



Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp     2011-01-23 23:00:15 UTC (rev 
40276)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp     2011-01-23 23:12:26 UTC (rev 
40277)
@@ -4090,13 +4090,8 @@

                lastCache = cache;

-               for (;;) {
-                       page = cache->LookupPage(context.cacheOffset);
-                       if (page == NULL || !page->busy) {
-                               // Either there is no page or there is one and 
it is not busy.
-                               break;
-                       }
-
+               page = cache->LookupPage(context.cacheOffset);
+               if (page != NULL&&  page->busy) {
                        // page must be busy -- wait for it to become unbusy
                        context.UnlockAll(cache);
                        cache->ReleaseRefLocked();

I looked at the diff with more context, and I am wondering whether the "return B_OK" was intentional, rather than restarting the loop...

Best regards,
-Stephan


Other related posts: