Minor performance enhancements in Surface collision testing
colliders = filter(lambda x: x.rect.collidepoint(point), self.surfaces)
if not colliders:
return False
- if filter(lambda x: not x, [c.collidePoint(point) for c in colliders]):
- return False
+ for c in colliders:
+ if not c.collidePoint(point):
+ return False
return True
if not colliders:
return False
#print [(c,c.rect,c.collideRect(rect)) for c in colliders]
- if filter(lambda x: not x, [c.collideRect(rect) for c in colliders]):
- return False
+ for c in colliders:
+ if not c.collideRect(rect):
+ return False
return True