Changeset 6557 for trunk/src


Ignore:
Timestamp:
Aug 18, 2001, 5:49:24 AM (24 years ago)
Author:
phaller
Message:

Performance improvement on ::findSection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibsect.cpp

    r5972 r6557  
    1 /* $Id: dibsect.cpp,v 1.55 2001-06-12 17:01:10 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.56 2001-08-18 03:49:24 phaller Exp $ */
    22
    33/*
     
    751751DIBSection *DIBSection::findObj(HANDLE handle)
    752752{
    753  DIBSection *dsect = section;
    754 
     753  // PH 2001-08-18 shortcut for performance optimization
     754  if (!section)
     755      return NULL;
     756
     757  DIBSection *dsect = section;
    755758  dibMutex.enter();
    756   while(dsect)
     759
     760  do
    757761  {
    758762    if(dsect->handle == handle)
     
    763767    dsect = dsect->next;
    764768  }
     769  while(dsect);
     770
    765771  dibMutex.leave();
    766772  return(NULL);
Note: See TracChangeset for help on using the changeset viewer.