OpenTween.Twitter.FindTopOfReplyChain C# (CSharp) Method

FindTopOfReplyChain() static private method

startStatusId からリプライ先の発言を辿る。発言は posts 以外からは検索しない。
static private FindTopOfReplyChain ( PostClass>.IDictionary posts, System.Int64 startStatusId ) : OpenTween.PostClass
posts PostClass>.IDictionary
startStatusId System.Int64
return OpenTween.PostClass
        internal static PostClass FindTopOfReplyChain(IDictionary<Int64, PostClass> posts, Int64 startStatusId)
        {
            if (!posts.ContainsKey(startStatusId))
                throw new ArgumentException("startStatusId (" + startStatusId + ") が posts の中から見つかりませんでした。", nameof(startStatusId));

            var nextPost = posts[startStatusId];
            while (nextPost.InReplyToStatusId != null)
            {
                if (!posts.ContainsKey(nextPost.InReplyToStatusId.Value))
                    break;
                nextPost = posts[nextPost.InReplyToStatusId.Value];
            }

            return nextPost;
        }