mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Make the cache version a const
This commit is contained in:
1 parent
ae4d7bb34c
commit
ede28de4a5
1 file changed
+3
-3
@@ -73,7 +73,7 @@ public class CachedAssembly<T> where T : ICacheable
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The version of the cache which increments on each format changes
|
/// The version of the cache which increments on each format changes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int Version => 0;
|
public const int VERSION = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of cached items inside the assembly.
|
/// List of cached items inside the assembly.
|
||||||
@@ -312,7 +312,7 @@ public static class TypeLoader
|
|||||||
|
|
||||||
using var br = new BinaryReader(File.OpenRead(path));
|
using var br = new BinaryReader(File.OpenRead(path));
|
||||||
var version = br.ReadInt32();
|
var version = br.ReadInt32();
|
||||||
if (version == CachedAssembly<T>.Version)
|
if (version == CachedAssembly<T>.VERSION)
|
||||||
{
|
{
|
||||||
var entriesCount = br.ReadInt32();
|
var entriesCount = br.ReadInt32();
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ public static class TypeLoader
|
|||||||
var path = Path.Combine(Paths.CachePath, $"{cacheName}_typeloader.dat");
|
var path = Path.Combine(Paths.CachePath, $"{cacheName}_typeloader.dat");
|
||||||
|
|
||||||
using var bw = new BinaryWriter(File.OpenWrite(path));
|
using var bw = new BinaryWriter(File.OpenWrite(path));
|
||||||
bw.Write(CachedAssembly<T>.Version);
|
bw.Write(CachedAssembly<T>.VERSION);
|
||||||
bw.Write(entries.Count);
|
bw.Write(entries.Count);
|
||||||
|
|
||||||
foreach (var kv in entries)
|
foreach (var kv in entries)
|
||||||
|
|||||||
Reference in new issue
Block a user