9250565 Fix check_cache bug in dealing with the callback

1 file Authored by simo 14 years ago, Committed by sgallagh 14 years ago,
    Fix check_cache bug in dealing with the callback
    
    Also rework check_cache so that the operations it makes are more explicit.
    Also add comments about why we are doing something.
    Should make the code easier to understand in future (took quite some time and
    discussion on IRC to understand exactly how this function was behaving and to
    find the callback passing bug).