File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Orm/Xtensive.Orm/Orm/Model Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,15 @@ public IndexInfo FindFirst(IndexAttributes indexAttributes) =>
4848 Find ( indexAttributes ) . FirstOrDefault ( ) ;
4949
5050 [ DebuggerStepThrough ]
51- public IndexInfo GetIndex ( string fieldName , params string [ ] fieldNames )
51+ public IndexInfo GetIndex ( string fieldName , params ReadOnlySpan < string > fieldNames )
5252 {
53- var names = ( fieldNames ?? Array . Empty < string > ( ) ) . Prepend ( fieldName ) ;
54-
5553 var fields = new List < FieldInfo > ( ) ;
5654 var reflectedTypeFields = primaryIndex . ReflectedType . Fields ;
57- foreach ( var name in names ) {
58- if ( reflectedTypeFields . TryGetValue ( name , out var field ) ) {
55+ if ( reflectedTypeFields . TryGetValue ( fieldName , out var field ) ) {
56+ fields . Add ( field ) ;
57+ }
58+ foreach ( var name in fieldNames ) {
59+ if ( reflectedTypeFields . TryGetValue ( name , out field ) ) {
5960 fields . Add ( field ) ;
6061 }
6162 }
You can’t perform that action at this time.
0 commit comments