using System.Runtime.CompilerServices; namespace UnityEngine.XR.ARSubsystems { static class AwaitableUtils { /// /// An `Awaitable` equivalent to C#'s `Task.FromResult`. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Awaitable FromResult( AwaitableCompletionSource completionSource, T result) { var awaitable = completionSource.Awaitable; completionSource.SetResult(result); completionSource.Reset(); return awaitable; } } }