File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
NHibernate.Test/SqlCommandTest Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -263,8 +263,8 @@ public void TrimAllParam()
263263 Parameter p2 = Parameter . Placeholder ;
264264
265265 SqlString sql = new SqlString ( new object [ ] { p1 , p2 } ) ;
266- sql = sql . Trim ( ) ;
267266
267+ Assert . That ( ReferenceEquals ( sql , sql . Trim ( ) ) , Is . True ) ;
268268 Assert . AreEqual ( "??" , sql . ToString ( ) ) ;
269269 }
270270
Original file line number Diff line number Diff line change @@ -702,6 +702,10 @@ public SqlString Trim()
702702 if ( _firstPartIndex < 0 ) return this ;
703703
704704 GetTrimmedIndexes ( out var sqlStartIndex , out var length ) ;
705+
706+ if ( _sqlStartIndex == sqlStartIndex && _length == length )
707+ return this ;
708+
705709 return length > 0
706710 ? new SqlString ( this , sqlStartIndex , length )
707711 : Empty ;
You can’t perform that action at this time.
0 commit comments