Last active
August 29, 2015 14:03
-
-
Save phrohdoh/11a6049d68dd4e12c580 to your computer and use it in GitHub Desktop.
Which is faster? I assume the first.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var near = self.World.FindActorsInCircle(self.CenterPosition, info.Range); | |
foreach (var actor in near) | |
{ | |
var foo = actor.TraitOrDefault<FooBar>(); | |
if (foo == null) return; | |
// do stuff | |
} | |
var near = self.World.FindActorsInCircle(self.CenterPosition, info.Range) | |
.Where(a => a.HasTrait<FooBar>()); | |
foreach (var actor in near) | |
{ | |
var foo = actor.Trait<FooBar>(); | |
// do stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment