Skip to content

Commit 63e3b52

Browse files
committed
Return null instead of EmptyDisposable
1 parent aec2333 commit 63e3b52

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Orm/Xtensive.Orm/Orm/Session.Persist.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace Xtensive.Orm
1818
{
1919
public partial class Session
2020
{
21-
private static readonly IDisposable EmptyDisposable = new Disposable(b => { return; });
22-
2321
private bool disableAutoSaveChanges;
2422
private KeyRemapper remapper;
2523
private bool persistingIsFailed;
@@ -246,7 +244,7 @@ public IDisposable DisableSaveChanges(IEntity target)
246244
targetEntity.EnsureNotRemoved();
247245
return Configuration.Supports(SessionOptions.AutoSaveChanges)
248246
? pinner.RegisterRoot(targetEntity.State)
249-
: EmptyDisposable; // No need to pin in this case
247+
: null; // No need to pin in this case
250248
}
251249

252250
/// <summary>
@@ -260,7 +258,7 @@ public IDisposable DisableSaveChanges(IEntity target)
260258
public IDisposable DisableSaveChanges()
261259
{
262260
if (!Configuration.Supports(SessionOptions.AutoSaveChanges)) {
263-
return EmptyDisposable; // No need to pin in this case
261+
return null; // No need to pin in this case
264262
}
265263
if (disableAutoSaveChanges)
266264
return null;

0 commit comments

Comments
 (0)