@@ -6,7 +6,7 @@ namespace NHibernate.AdoNet
6
6
/// <summary> Implementation of ColumnNameCache. </summary>
7
7
public class ColumnNameCache
8
8
{
9
- private readonly ReaderWriterLockSlim cacheLock = new ReaderWriterLockSlim ( ) ;
9
+ private readonly ReaderWriterLockSlim cacheLock = new ReaderWriterLockSlim ( ) ;
10
10
private readonly Dictionary < string , int ? > columnNameToIndexCache ;
11
11
12
12
public ColumnNameCache ( int columnCount )
@@ -17,45 +17,45 @@ public ColumnNameCache(int columnCount)
17
17
18
18
public int GetIndexForColumnName ( string columnName , ResultSetWrapper rs )
19
19
{
20
- int ? cached = Read ( columnName ) ;
20
+ int ? cached = Read ( columnName ) ;
21
21
if ( cached . HasValue )
22
22
{
23
23
return cached . Value ;
24
24
}
25
25
else
26
26
{
27
27
int index = rs . Target . GetOrdinal ( columnName ) ;
28
- Insert ( columnName , index ) ;
28
+ Insert ( columnName , index ) ;
29
29
return index ;
30
30
}
31
31
}
32
32
33
- private int ? Read ( string key )
34
- {
35
- cacheLock . EnterReadLock ( ) ;
36
- try
37
- {
38
- int ? value ;
39
- columnNameToIndexCache . TryGetValue ( key , out value ) ;
40
- return value ;
41
- }
42
- finally
43
- {
44
- cacheLock . ExitReadLock ( ) ;
45
- }
46
- }
33
+ private int ? Read ( string key )
34
+ {
35
+ cacheLock . EnterReadLock ( ) ;
36
+ try
37
+ {
38
+ int ? value ;
39
+ columnNameToIndexCache . TryGetValue ( key , out value ) ;
40
+ return value ;
41
+ }
42
+ finally
43
+ {
44
+ cacheLock . ExitReadLock ( ) ;
45
+ }
46
+ }
47
47
48
- private void Insert ( string key , int value )
49
- {
50
- cacheLock . EnterWriteLock ( ) ;
51
- try
52
- {
53
- columnNameToIndexCache [ key ] = value ;
54
- }
55
- finally
56
- {
57
- cacheLock . ExitWriteLock ( ) ;
58
- }
59
- }
48
+ private void Insert ( string key , int value )
49
+ {
50
+ cacheLock . EnterWriteLock ( ) ;
51
+ try
52
+ {
53
+ columnNameToIndexCache [ key ] = value ;
54
+ }
55
+ finally
56
+ {
57
+ cacheLock . ExitWriteLock ( ) ;
58
+ }
59
+ }
60
60
}
61
61
}
0 commit comments