Removing checks that are only necessary on first pass I've got a function that's executed in a game loop. There are a couple of checks that are really only necessary during the first pass of the game loop. How can I remove these? There is more code like this, but this is the shortest example.

public void Update(Frame rawBodyData)
{
    //Catch the first pass, where RawBody and FilteredBody are null
    //I'd like to remove this check
    if (RawBody.IsNull())
    {
        RawBody = rawBodyData;
    }
    //And this check
    if (FilteredBody.IsNull())
    {
        FilteredBody = rawBodyData;
    }

    _partiallyFilteredBody = rawBodyData;

    foreach (var filter in Filters)
    {
        //Check is a certain flag is set
        if ((_filterMethods &amp; filter.Key) != 0)
        {
            _partiallyFilteredBody = filter.Value.Filter(_partiallyFilteredBody, FilteredBody);
        }
    }

    FilteredBody = _partiallyFilteredBody;
    RawBody = rawBodyData;
}


Other comments are certainly welcome. This is supposed to be high performance code, so I'd like to avoid things like LINQ (which ReSharper is already suggesting).
You can remove the check for RawBody.IsNull() because you don't read the value of RawBody inside this method. If at the other places where some similiar code is called the rawBody is read, I would suggest to extract this check to a separate method and setting a flag which indicates that the check is already done. Like  

private bool _bodyValueIsAssigned = false;
private void AssignValueIfNotAssigned(Frame frame)
{
    if (_bodyValueIsAssigned) { return; }

    if (RawBody.IsNull())
    {
        RawBody = frame;
    }

    if (FilteredBody.IsNull())
    {
        FilteredBody = frame;
    }

    _bodyValueIsAssigned  = true;
}


This can be called for the point where you call the Update() method. Without seeing more about how this is called (from an event or something similiar) there can't be said more.  



If Filters is a List&lt;T&gt; or an array you should use performance wise a for loop instead of a foreach. See: https://stackoverflow.com/a/365658