Skip to content

Commit

Permalink
Remove redundant data when generating NonDependentRelFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
welkin22 committed Nov 13, 2024
1 parent dd1ea36 commit 43a4419
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/types/dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func mockSystemTxDAGWithLargeDeps() TxDAG {
dag.TxDeps[7].TxIndexes = []uint64{3}
dag.TxDeps[8].TxIndexes = []uint64{}
//dag.TxDeps[9].TxIndexes = []uint64{0, 1, 2, 6, 7, 8}
dag.TxDeps[9] = NewTxDep([]uint64{3, 4, 5, 10, 11}, NonDependentRelFlag)
dag.TxDeps[9] = NewTxDep([]uint64{3, 4, 5}, NonDependentRelFlag)
dag.TxDeps[10] = NewTxDep([]uint64{}, ExcludedTxFlag)
dag.TxDeps[11] = NewTxDep([]uint64{}, ExcludedTxFlag)
return dag
Expand Down
4 changes: 2 additions & 2 deletions core/types/mvstates.go
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,8 @@ func (s *MVStates) ResolveTxDAG(txCnt int, extraTxDeps ...TxDep) (TxDAG, error)
// if tx deps larger than half of txs, then convert with NonDependentRelFlag
txDAG.TxDeps[i].SetFlag(NonDependentRelFlag)
nd := make([]uint64, 0, totalCnt-1-len(txDAG.TxDeps[i].TxIndexes))
for j := uint64(0); j < uint64(totalCnt); j++ {
if !slices.Contains(txDAG.TxDeps[i].TxIndexes, j) && j != uint64(i) {
for j := uint64(0); j < uint64(i); j++ {
if !slices.Contains(txDAG.TxDeps[i].TxIndexes, j) {
nd = append(nd, j)
}
}
Expand Down

0 comments on commit 43a4419

Please sign in to comment.