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()
263
263
Parameter p2 = Parameter . Placeholder ;
264
264
265
265
SqlString sql = new SqlString ( new object [ ] { p1 , p2 } ) ;
266
- sql = sql . Trim ( ) ;
267
266
267
+ Assert . That ( ReferenceEquals ( sql , sql . Trim ( ) ) , Is . True ) ;
268
268
Assert . AreEqual ( "??" , sql . ToString ( ) ) ;
269
269
}
270
270
Original file line number Diff line number Diff line change @@ -702,6 +702,10 @@ public SqlString Trim()
702
702
if ( _firstPartIndex < 0 ) return this ;
703
703
704
704
GetTrimmedIndexes ( out var sqlStartIndex , out var length ) ;
705
+
706
+ if ( _sqlStartIndex == sqlStartIndex && _length == length )
707
+ return this ;
708
+
705
709
return length > 0
706
710
? new SqlString ( this , sqlStartIndex , length )
707
711
: Empty ;
You can’t perform that action at this time.
0 commit comments