internal ValueTask <IMemoryOwner <byte> > GetBlockAsync(AsyncBlockManager block) { if (block.Task.IsCompletedSuccessfully) { return(new ValueTask <IMemoryOwner <byte> >(block.GetMemoryManager())); } return(InternalGetBlockAsync(block));
static async ValueTask <IMemoryOwner <byte> > InternalGetBlockAsync(AsyncBlockManager block) { await block.Task; return(block.GetMemoryManager()); }