Skip to content

Commit

Permalink
Delete old unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Sep 20, 2024
1 parent 5fe64a2 commit b7d50dc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 64 deletions.
27 changes: 1 addition & 26 deletions src/NexusMods.MnemonicDB.Abstractions/Attribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public abstract partial class Attribute<TValueType, TLowLevelType> : IAttribute<

private static Encoding Utf8Encoding = Encoding.UTF8;


protected RegistryId.InlineCache Cache;

protected Attribute(
ValueTags lowLevelType,
string ns,
Expand Down Expand Up @@ -173,12 +170,6 @@ protected virtual TValueType FromLowLevel(double value, ValueTags tags, Attribut
/// <inheritdoc />
public virtual bool DeclaredOptional { get; protected init; }

/// <inheritdoc />
public void SetDbId(RegistryId id, AttributeId attributeId)
{
Cache[id.Value] = attributeId;
}

/// <inheritdoc />
public Type ValueType => typeof(TValueType);

Expand Down Expand Up @@ -277,15 +268,6 @@ public override string ToString()
{
return Id.ToString();
}

/// <summary>
/// Gets a service provider thats specific to this registry defined by the registry id
/// </summary>
protected IServiceProvider GetServiceProvider(RegistryId registryId)
{
throw new NotImplementedException();
//return AttributeRegistryRegistry.Registries[registryId.Value]!.ServiceProvider;
}

/// <summary>
/// Typed datom for this attribute
Expand Down Expand Up @@ -343,9 +325,7 @@ public void Retract(ITransaction tx)

/// <inheritdoc />
public Type ValueType => typeof(TValueType);

public KeyPrefix prefix { get; init; }


/// <inheritdoc />
public override string ToString()
{
Expand All @@ -365,10 +345,5 @@ public int HashCodeByValue()
{
return HashCode.Combine(A, E, V);
}

public void Deconstruct(out KeyPrefix prefix)
{
prefix = this.prefix;
}
}
}
7 changes: 0 additions & 7 deletions src/NexusMods.MnemonicDB.Abstractions/IAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ public interface IAttribute
/// </summary>
public Symbol Id { get; }

/// <summary>
/// Sets the unique id of the attribute for the given registry
/// </summary>
/// <param name="id"></param>
/// <param name="attributeId"></param>
public void SetDbId(RegistryId id, AttributeId attributeId);

/// <summary>
/// True if the attribute is indexed, false if it is not.
/// </summary>
Expand Down
27 changes: 0 additions & 27 deletions src/NexusMods.MnemonicDB.Abstractions/RegistryId.cs

This file was deleted.

6 changes: 2 additions & 4 deletions src/NexusMods.MnemonicDB/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace NexusMods.MnemonicDB;
internal class Db : IDb
{
private readonly IndexSegmentCache _cache;
private readonly RegistryId _registryId;

/// <summary>
/// The connection is used by several methods to navigate the graph of objects of Db, Connection, Datom Store, and
Expand All @@ -42,10 +41,9 @@ public Db(ISnapshot snapshot, TxId txId, AttributeCache attributeCache)
RecentlyAdded = snapshot.Datoms(SliceDescriptor.Create(txId));
}

private Db(ISnapshot snapshot, TxId txId, AttributeCache attributeCache, RegistryId registryId, IConnection connection, IndexSegmentCache newCache, IndexSegment recentlyAdded)
private Db(ISnapshot snapshot, TxId txId, AttributeCache attributeCache, IConnection connection, IndexSegmentCache newCache, IndexSegment recentlyAdded)
{
AttributeCache = attributeCache;
_registryId = registryId;
_cache = newCache;
_connection = connection;
Snapshot = snapshot;
Expand All @@ -60,7 +58,7 @@ private Db(ISnapshot snapshot, TxId txId, AttributeCache attributeCache, Registr
internal Db WithNext(StoreResult storeResult, TxId txId)
{
var newCache = _cache.ForkAndEvict(storeResult, AttributeCache, out var newDatoms);
return new Db(storeResult.Snapshot, txId, AttributeCache, _registryId, _connection!, newCache, newDatoms);
return new Db(storeResult.Snapshot, txId, AttributeCache, _connection!, newCache, newDatoms);
}

private IndexSegment EntityDatoms(IDb db, EntityId id)
Expand Down

0 comments on commit b7d50dc

Please sign in to comment.