diff --git a/src/Build/Logging/SerialConsoleLogger.cs b/src/Build/Logging/SerialConsoleLogger.cs
index af18d6813ed..20522e7e2bb 100644
--- a/src/Build/Logging/SerialConsoleLogger.cs
+++ b/src/Build/Logging/SerialConsoleLogger.cs
@@ -822,7 +822,7 @@ internal enum FrameType
internal struct Frame
{
///
- /// Creates a new instance of frame with all fields specified.
+ /// Initializes a new instance of the struct with all fields specified.
///
/// the type of the this frame
/// display state. true indicates this frame has been displayed to the user
@@ -907,14 +907,14 @@ internal class FrameStack
/// The frames member is contained by FrameStack and does
/// all the heavy lifting for FrameStack.
///
- private System.Collections.Stack _frames;
+ private readonly Stack _frames;
///
- /// Create a new, empty, FrameStack.
+ /// Initializes a new instance of the class.
///
internal FrameStack()
{
- _frames = new System.Collections.Stack();
+ _frames = new Stack();
}
///
@@ -923,7 +923,7 @@ internal FrameStack()
/// Thrown when stack is empty.
internal Frame Pop()
{
- return (Frame)(_frames.Pop());
+ return _frames.Pop();
}
///
@@ -931,7 +931,7 @@ internal Frame Pop()
///
internal Frame Peek()
{
- return (Frame)(_frames.Peek());
+ return _frames.Peek();
}
///
diff --git a/src/Tasks/ParserState.cs b/src/Tasks/ParserState.cs
index d6a64cd042f..5bfc18c8401 100644
--- a/src/Tasks/ParserState.cs
+++ b/src/Tasks/ParserState.cs
@@ -3,7 +3,7 @@
using System;
using System.Text;
-using System.Collections;
+using System.Collections.Generic;
#nullable disable
@@ -19,7 +19,7 @@ internal sealed class ParseState
private int _openConditionalDirectives;
// A stack of namespaces so that nested namespaces can be supported.
- private readonly Stack _namespaceStack = new Stack();
+ private readonly Stack _namespaceStack = new Stack();
internal ParseState()
{
@@ -90,7 +90,7 @@ internal string PopNamespacePart()
return null;
}
- return (string)_namespaceStack.Pop();
+ return _namespaceStack.Pop();
}
///