Skip to content

Commit 6312442

Browse files
committed
fixup! Code cleanup
Remove renames
1 parent 0b578a6 commit 6312442

File tree

4 files changed

+39
-39
lines changed

4 files changed

+39
-39
lines changed

src/NHibernate/Action/BulkOperationCleanupAction.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public partial class BulkOperationCleanupAction :
2020
ICacheableExecutable
2121
{
2222
private readonly ISessionFactoryImplementor _factory;
23-
private readonly HashSet<string> _affectedEntityNames;
24-
private readonly HashSet<string> _affectedCollectionRoles;
25-
private readonly string[] _spaces;
23+
private readonly HashSet<string> affectedEntityNames;
24+
private readonly HashSet<string> affectedCollectionRoles;
25+
private readonly string[] spaces;
2626
private readonly bool _hasCache;
2727

2828
public BulkOperationCleanupAction(ISessionImplementor session, IQueryable[] affectedQueryables)
@@ -34,29 +34,29 @@ public BulkOperationCleanupAction(ISessionImplementor session, IQueryable[] affe
3434
if (queryables.HasCache)
3535
{
3636
_hasCache = true;
37-
if (_affectedEntityNames == null)
37+
if (affectedEntityNames == null)
3838
{
39-
_affectedEntityNames = new HashSet<string>();
39+
affectedEntityNames = new HashSet<string>();
4040
}
4141

42-
_affectedEntityNames.Add(queryables.EntityName);
42+
affectedEntityNames.Add(queryables.EntityName);
4343
}
4444

4545
var roles = _factory.GetCollectionRolesByEntityParticipant(queryables.EntityName);
4646
if (roles != null)
4747
{
48-
if (_affectedCollectionRoles == null)
48+
if (affectedCollectionRoles == null)
4949
{
50-
_affectedCollectionRoles = new HashSet<string>();
50+
affectedCollectionRoles = new HashSet<string>();
5151
}
5252

53-
_affectedCollectionRoles.UnionWith(roles);
53+
affectedCollectionRoles.UnionWith(roles);
5454
}
5555

5656
tmpSpaces.UnionWith(queryables.QuerySpaces);
5757
}
5858

59-
_spaces = tmpSpaces.ToArray();
59+
spaces = tmpSpaces.ToArray();
6060
}
6161

6262
/// <summary>
@@ -80,29 +80,29 @@ public BulkOperationCleanupAction(ISessionImplementor session, ISet<string> quer
8080
if (persister.HasCache)
8181
{
8282
_hasCache = true;
83-
if (_affectedEntityNames == null)
83+
if (affectedEntityNames == null)
8484
{
85-
_affectedEntityNames = new HashSet<string>();
85+
affectedEntityNames = new HashSet<string>();
8686
}
8787

88-
_affectedEntityNames.Add(persister.EntityName);
88+
affectedEntityNames.Add(persister.EntityName);
8989
}
9090

9191
var roles = session.Factory.GetCollectionRolesByEntityParticipant(persister.EntityName);
9292
if (roles != null)
9393
{
94-
if (_affectedCollectionRoles == null)
94+
if (affectedCollectionRoles == null)
9595
{
96-
_affectedCollectionRoles = new HashSet<string>();
96+
affectedCollectionRoles = new HashSet<string>();
9797
}
9898

99-
_affectedCollectionRoles.UnionWith(roles);
99+
affectedCollectionRoles.UnionWith(roles);
100100
}
101101

102102
tmpSpaces.UnionWith(entitySpaces);
103103
}
104104
}
105-
_spaces = tmpSpaces.ToArray();
105+
spaces = tmpSpaces.ToArray();
106106
}
107107

108108
private bool AffectedEntity(ISet<string> querySpaces, string[] entitySpaces)
@@ -119,7 +119,7 @@ private bool AffectedEntity(ISet<string> querySpaces, string[] entitySpaces)
119119

120120
#region IExecutable Members
121121

122-
public string[] PropertySpaces => _spaces;
122+
public string[] PropertySpaces => spaces;
123123

124124
public void BeforeExecutions()
125125
{
@@ -155,17 +155,17 @@ public void ExecuteAfterTransactionCompletion(bool success)
155155

156156
private void EvictCollectionRegions()
157157
{
158-
if (_affectedCollectionRoles != null)
158+
if (affectedCollectionRoles != null)
159159
{
160-
_factory.EvictCollection(_affectedCollectionRoles);
160+
_factory.EvictCollection(affectedCollectionRoles);
161161
}
162162
}
163163

164164
private void EvictEntityRegions()
165165
{
166-
if (_affectedEntityNames != null)
166+
if (affectedEntityNames != null)
167167
{
168-
_factory.EvictEntity(_affectedEntityNames);
168+
_factory.EvictEntity(affectedEntityNames);
169169
}
170170
}
171171

src/NHibernate/Async/Action/BulkOperationCleanupAction.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ private Task EvictCollectionRegionsAsync(CancellationToken cancellationToken)
7575
{
7676
return Task.FromCanceled<object>(cancellationToken);
7777
}
78-
if (_affectedCollectionRoles != null)
78+
if (affectedCollectionRoles != null)
7979
{
80-
return _factory.EvictCollectionAsync(_affectedCollectionRoles, cancellationToken);
80+
return _factory.EvictCollectionAsync(affectedCollectionRoles, cancellationToken);
8181
}
8282
return Task.CompletedTask;
8383
}
@@ -88,9 +88,9 @@ private Task EvictEntityRegionsAsync(CancellationToken cancellationToken)
8888
{
8989
return Task.FromCanceled<object>(cancellationToken);
9090
}
91-
if (_affectedEntityNames != null)
91+
if (affectedEntityNames != null)
9292
{
93-
return _factory.EvictEntityAsync(_affectedEntityNames, cancellationToken);
93+
return _factory.EvictEntityAsync(affectedEntityNames, cancellationToken);
9494
}
9595
return Task.CompletedTask;
9696
}

src/NHibernate/Async/Engine/ActionQueue.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ private Task PreInvalidateCachesAsync(CancellationToken cancellationToken)
4545
{
4646
return Task.FromCanceled<object>(cancellationToken);
4747
}
48-
if (session.Factory.Settings.IsQueryCacheEnabled && _spacesToInvalidate.Count > 0)
48+
if (session.Factory.Settings.IsQueryCacheEnabled && executedSpaces.Count > 0)
4949
{
50-
return session.Factory.UpdateTimestampsCache.PreInvalidateAsync(_spacesToInvalidate, cancellationToken);
50+
return session.Factory.UpdateTimestampsCache.PreInvalidateAsync(executedSpaces, cancellationToken);
5151
}
5252
return Task.CompletedTask;
5353
}
@@ -165,12 +165,12 @@ public async Task AfterTransactionCompletionAsync(bool success, CancellationToke
165165
private async Task InvalidateCachesAsync(CancellationToken cancellationToken)
166166
{
167167
cancellationToken.ThrowIfCancellationRequested();
168-
if (session.Factory.Settings.IsQueryCacheEnabled && _spacesToInvalidate.Count > 0)
168+
if (session.Factory.Settings.IsQueryCacheEnabled && executedSpaces.Count > 0)
169169
{
170-
await (session.Factory.UpdateTimestampsCache.InvalidateAsync(_spacesToInvalidate, cancellationToken)).ConfigureAwait(false);
170+
await (session.Factory.UpdateTimestampsCache.InvalidateAsync(executedSpaces, cancellationToken)).ConfigureAwait(false);
171171
}
172172

173-
_spacesToInvalidate.Clear();
173+
executedSpaces.Clear();
174174
}
175175
private partial class BeforeTransactionCompletionProcessQueue
176176
{

src/NHibernate/Engine/ActionQueue.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public partial class ActionQueue
4343

4444
private readonly AfterTransactionCompletionProcessQueue afterTransactionProcesses;
4545
private readonly BeforeTransactionCompletionProcessQueue beforeTransactionProcesses;
46-
private readonly HashSet<string> _spacesToInvalidate;
46+
private readonly HashSet<string> executedSpaces;
4747

4848
public ActionQueue(ISessionImplementor session)
4949
{
@@ -59,7 +59,7 @@ public ActionQueue(ISessionImplementor session)
5959
afterTransactionProcesses = new AfterTransactionCompletionProcessQueue();
6060
beforeTransactionProcesses = new BeforeTransactionCompletionProcessQueue();
6161

62-
_spacesToInvalidate = new HashSet<string>();
62+
executedSpaces = new HashSet<string>();
6363
}
6464

6565
public virtual void Clear()
@@ -172,9 +172,9 @@ private void ExecuteActions<T>(List<T> list) where T: IExecutable
172172

173173
private void PreInvalidateCaches()
174174
{
175-
if (session.Factory.Settings.IsQueryCacheEnabled && _spacesToInvalidate.Count > 0)
175+
if (session.Factory.Settings.IsQueryCacheEnabled && executedSpaces.Count > 0)
176176
{
177-
session.Factory.UpdateTimestampsCache.PreInvalidate(_spacesToInvalidate);
177+
session.Factory.UpdateTimestampsCache.PreInvalidate(executedSpaces);
178178
}
179179
}
180180

@@ -219,7 +219,7 @@ private void RegisterCleanupActions(IExecutable executable)
219219

220220
if (executable.PropertySpaces != null && (!(executable is ICacheableExecutable ce) || ce.HasCache))
221221
{
222-
_spacesToInvalidate.UnionWith(executable.PropertySpaces);
222+
executedSpaces.UnionWith(executable.PropertySpaces);
223223
}
224224
}
225225

@@ -295,12 +295,12 @@ public void AfterTransactionCompletion(bool success)
295295

296296
private void InvalidateCaches()
297297
{
298-
if (session.Factory.Settings.IsQueryCacheEnabled && _spacesToInvalidate.Count > 0)
298+
if (session.Factory.Settings.IsQueryCacheEnabled && executedSpaces.Count > 0)
299299
{
300-
session.Factory.UpdateTimestampsCache.Invalidate(_spacesToInvalidate);
300+
session.Factory.UpdateTimestampsCache.Invalidate(executedSpaces);
301301
}
302302

303-
_spacesToInvalidate.Clear();
303+
executedSpaces.Clear();
304304
}
305305

306306
/// <summary>

0 commit comments

Comments
 (0)