Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Sep 6, 2024
1 parent fd2069c commit 9ce3f83
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import VergeComparator

public enum NormalizedStorageComparisons<Storage: NormalizedStorageType> {
public enum NormalizedStorageComparators<Storage: NormalizedStorageType> {

/// True indicates database is not changed
public struct StorageComparison: TypedComparator {
public struct StorageComparator: TypedComparator {
public typealias Input = Storage

public init() {}
Expand All @@ -14,7 +14,7 @@ public enum NormalizedStorageComparisons<Storage: NormalizedStorageType> {
}

/// Returns true if the table of the entity in database has no changes.
public struct TableComparison<Table: TableType>: TypedComparator {
public struct TableComparator<Table: TableType>: TypedComparator {

public typealias Input = Table

Expand Down
8 changes: 4 additions & 4 deletions Sources/VergeNormalizationDerived/DispatcherType+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ where _StorageSelector.Storage == _TableSelector.Storage {
return .new(yield(input))
}

if NormalizedStorageComparisons<Storage>.StorageComparison()(selector.storage(source: input.primitive), selector.storage(source: previous.primitive)) {
if NormalizedStorageComparators<Storage>.StorageComparator()(selector.storage(source: input.primitive), selector.storage(source: previous.primitive)) {
return .noUpdates
}

if NormalizedStorageComparisons<Storage>.TableComparison<_TableSelector.Table>()(selector.table(source: input.primitive), selector.table(source: previous.primitive)) {
if NormalizedStorageComparators<Storage>.TableComparator<_TableSelector.Table>()(selector.table(source: input.primitive), selector.table(source: previous.primitive)) {
return .noUpdates
}

Expand Down Expand Up @@ -418,11 +418,11 @@ where _StorageSelector.Storage == _TableSelector.Storage {
return .new(yield(input))
}

if NormalizedStorageComparisons<Storage>.StorageComparison()(selector.storage(source: input.primitive), selector.storage(source: previous.primitive)) {
if NormalizedStorageComparators<Storage>.StorageComparator()(selector.storage(source: input.primitive), selector.storage(source: previous.primitive)) {
return .noUpdates
}

if NormalizedStorageComparisons<Storage>.TableComparison<_TableSelector.Table>()(selector.table(source: input.primitive), selector.table(source: previous.primitive)) {
if NormalizedStorageComparators<Storage>.TableComparator<_TableSelector.Table>()(selector.table(source: input.primitive), selector.table(source: previous.primitive)) {
return .noUpdates
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/VergeNormalizationDerived/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct QueryPipeline<
}

// check if the storage has been updated
if NormalizedStorageComparisons<Storage>.StorageComparison()(storageSelector.select(source: input.primitive), storageSelector.select(source: previous.primitive)) {
if NormalizedStorageComparators<Storage>.StorageComparator()(storageSelector.select(source: input.primitive), storageSelector.select(source: previous.primitive)) {
return .noUpdates
}

Expand Down

0 comments on commit 9ce3f83

Please sign in to comment.