SILUBS.ScriptureChecks.ProcessMatchedPairTokens.RemoveIfMatchedPairFound C# (CSharp) Method

RemoveIfMatchedPairFound() private method

Checks if the last two pair tokens in the found pair tokens are a matched pair. If so, they are removed from the found list since a matched set has been complete.
private RemoveIfMatchedPairFound ( ) : void
return void
		private void RemoveIfMatchedPairFound()
		{
			if (m_pairTokensFound.Count < 2)
				return;

			TextTokenSubstring possibleClose = m_pairTokensFound[m_pairTokensFound.Count - 1];
			TextTokenSubstring possibleOpen = m_pairTokensFound[m_pairTokensFound.Count - 2];

			if (m_pairList.IsMatchedPair(possibleOpen.Text, possibleClose.Text))
			{
				// Found a matched pair, remove last two tokens
				m_pairTokensFound.RemoveAt(m_pairTokensFound.Count - 1);
				m_pairTokensFound.RemoveAt(m_pairTokensFound.Count - 1);
			}
		}