Contact: fumanchu@aminus.org

Log in as guest/geniusql to create tickets

Changeset 101

Show
Ignore:
Timestamp:
07/29/07 01:43:47
Author:
fumanchu
Message:

optimization for _select_lazy

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/geniusql/objects.py

    r100 r101  
    456456        dataset = self.schema.db.select((self, attrs, restriction, order), 
    457457                                        limit=limit, strict=False) 
    458         for row in dataset: 
    459             row = dict(zip(attrs, row)) 
    460             if restriction and dataset.selector.imperfect: 
    461                 # Run a dummy object through our restriction before yielding. 
     458        if restriction and dataset.selector.imperfect: 
     459            # Run a dummy object through our restriction before yielding. 
     460            for row in dataset: 
     461                row = dict(zip(attrs, row)) 
    462462                if not restriction(_ImperfectDummy(**row)): 
    463463                    continue 
    464             yield row 
     464                yield row 
     465        else: 
     466            for row in dataset: 
     467                yield dict(zip(attrs, row)) 
    465468     
    466469