Skip to content

Commit

Permalink
fix(lssync): fix computeDependencies method
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricenclos committed Dec 4, 2018
1 parent 1a3b091 commit 4c620ee
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/syncImpl/LSSync.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { LogootSDel, LogootSOperation } from "mute-structs";
import { Sync } from "../core";
import { LogootSDel, LogootSOperation } from 'mute-structs'
import { Sync } from '../core'

export class LSSync extends Sync<LogootSOperation> {
computeDependencies ({ lid }: LogootSDel): Map<number, number> {
computeDependencies(op: LogootSOperation): Map<number, number> {
const map = new Map()
lid.forEach(({ idBegin: { replicaNumber } }) => {
map.set(replicaNumber, this.vector.get(replicaNumber))
})
if (op instanceof LogootSDel) {
op.lid.forEach(({ idBegin: { replicaNumber } }) => {
map.set(replicaNumber, this.vector.get(replicaNumber))
})
}
return map
}
}
}

0 comments on commit 4c620ee

Please sign in to comment.