File tree Expand file tree Collapse file tree
Sql/Compiler/Internals/Nodes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ namespace Xtensive.Orm.Building.Definitions
2121 /// <summary>
2222 /// Defines a single persistent type.
2323 /// </summary>
24- [ DebuggerDisplay ( "{underlyingType }" ) ]
24+ [ DebuggerDisplay ( "{UnderlyingType }" ) ]
2525 [ Serializable ]
2626 public sealed class TypeDef : SchemaMappedNode
2727 {
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ namespace Xtensive.Orm.Linq
2424{
2525 internal sealed class TranslatorContext
2626 {
27- private readonly static System . Type TagProviderType = typeof ( TagProvider ) ;
28-
2927 private readonly AliasGenerator resultAliasGenerator ;
3028 private readonly AliasGenerator columnAliasGenerator ;
3129 private readonly Dictionary < ParameterExpression , Parameter < Tuple > > tupleParameters ;
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ internal override void AcceptVisitor(NodeVisitor visitor)
164164 internal void FlushBuffer ( )
165165 {
166166 if ( stringBuilder . Length > 0 ) {
167- children . Add ( new TextNode ( stringBuilder . ToString ( ) ) ) ;
167+ children . Add ( TextNode . Create ( stringBuilder . ToString ( ) ) ) ;
168168 lastNodeIsText = true ;
169169 lastChar = stringBuilder [ ^ 1 ] ;
170170 _ = stringBuilder . Clear ( ) ;
Original file line number Diff line number Diff line change @@ -9,18 +9,29 @@ namespace Xtensive.Sql.Compiler
99 [ DebuggerDisplay ( "Text = {Text}" ) ]
1010 internal class TextNode : Node
1111 {
12+ private const string CommaString = ", " ;
13+ private static readonly TextNode CommaNode = new TextNode ( CommaString ) ;
14+
1215 public readonly string Text ;
1316
14- internal override void AcceptVisitor ( NodeVisitor visitor )
17+ public static TextNode Create ( string text )
1518 {
16- visitor . Visit ( this ) ;
19+ if ( text . Length < 3 ) {
20+ text = string . Intern ( text ) ;
21+ if ( text == CommaString ) {
22+ return CommaNode ;
23+ }
24+ }
25+ return new TextNode ( text ) ;
1726 }
1827
28+ internal override void AcceptVisitor ( NodeVisitor visitor ) => visitor . Visit ( this ) ;
29+
1930 // Constructor
2031
2132 public TextNode ( string text )
2233 {
2334 Text = text ;
2435 }
2536 }
26- }
37+ }
You can’t perform that action at this time.
0 commit comments