Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 9e7a370

Browse files
Utilizing struct defaults
1 parent 18779df commit 9e7a370

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,6 @@ public ConfigRemoteDictionary(IDictionary<string, ConfigRemote> dictionary)
415415
[Location("cache/repoinfo.yaml", LocationAttribute.Location.LibraryFolder)]
416416
sealed class RepositoryInfoCache : ManagedCacheBase<RepositoryInfoCache>, IRepositoryInfoCache
417417
{
418-
public static readonly GitRemote DefaultGitRemote = new GitRemote();
419-
public static readonly GitBranch DefaultGitBranch = new GitBranch();
420-
421418
[SerializeField] private string lastUpdatedAtString = DateTimeOffset.MinValue.ToString();
422419
[SerializeField] private string lastVerifiedAtString = DateTimeOffset.MinValue.ToString();
423420
[SerializeField] private GitRemote gitRemote;
@@ -428,7 +425,7 @@ public GitRemote? CurrentGitRemote
428425
get
429426
{
430427
ValidateData();
431-
return gitRemote.Equals(DefaultGitRemote) ? (GitRemote?)null : gitRemote;
428+
return gitRemote.Equals(GitRemote.Default) ? (GitRemote?)null : gitRemote;
432429
}
433430
set
434431
{
@@ -439,7 +436,7 @@ public GitRemote? CurrentGitRemote
439436

440437
if (!Nullable.Equals(gitRemote, value))
441438
{
442-
gitRemote = value ?? DefaultGitRemote;
439+
gitRemote = value ?? GitRemote.Default;
443440
isUpdated = true;
444441
}
445442

@@ -452,7 +449,7 @@ public GitBranch? CurentGitBranch
452449
get
453450
{
454451
ValidateData();
455-
return gitBranch.Equals(DefaultGitBranch) ? (GitBranch?)null : gitBranch;
452+
return gitBranch.Equals(GitBranch.Default) ? (GitBranch?)null : gitBranch;
456453
}
457454
set
458455
{
@@ -463,7 +460,7 @@ public GitBranch? CurentGitBranch
463460

464461
if (!Nullable.Equals(gitBranch, value))
465462
{
466-
gitBranch = value ?? DefaultGitBranch;
463+
gitBranch = value ?? GitBranch.Default;
467464
isUpdated = true;
468465
}
469466

0 commit comments

Comments
 (0)