func (tr *transaction) delete(j *job) {
	log.WithField("j", j).Debug("tr.delete")

	delete(tr.merged, j.unit)

	for deps, f := range map[*set]func(*job){
		&j.wantedBy: func(depender *job) {
			delete(depender.wants, j)
		},
		&j.requiredBy: func(depender *job) {
			delete(depender.requires, j)
			defer tr.delete(depender)
		},
		&j.conflictedBy: func(depender *job) {
			delete(depender.conflicts, j)
			defer tr.delete(depender)
		},

		&j.wants: func(dependency *job) {
			delete(dependency.wantedBy, j)
			if dependency.isOrphan() {
				defer tr.delete(dependency)
			}
		},
		&j.requires: func(dependency *job) {
			delete(dependency.requiredBy, j)
			if dependency.isOrphan() {
				defer tr.delete(dependency)
			}
		},
		&j.conflicts: func(dependency *job) {
			delete(dependency.conflictedBy, j)
			if dependency.isOrphan() {
				defer tr.delete(dependency)
			}
		},
	} {
		for dep := range *deps {
			f(dep)
		}
	}
}
// deletes j from transaction
// removes all references to j
// recurses on orphaned and broken jobs
deletes j from transaction
removes all references to j
recurses on orphaned and broken jobs
// deletes j from transaction // removes all references to j // recurses on orphaned and broken jobs
func (tr *transaction) delete(j *job) {
	log.WithField("j", j).Debug("tr.delete")
	delete(tr.merged, j.unit)
	for deps, f := range map[*set]func(*job){
		&j.wantedBy: func(depender *job) {
			delete(depender.wants, j)
		},
		&j.requiredBy: func(depender *job) {
			delete(depender.requires, j)
			defer tr.delete(depender)
		},
		&j.conflictedBy: func(depender *job) {
			delete(depender.conflicts, j)
			defer tr.delete(depender)
		},
		&j.wants: func(dependency *job) {
			delete(dependency.wantedBy, j)
			if dependency.isOrphan() {
				defer tr.delete(dependency)
			}
		},
		&j.requires: func(dependency *job) {
			delete(dependency.requiredBy, j)
			if dependency.isOrphan() {
				defer tr.delete(dependency)
			}
		},
		&j.conflicts: func(dependency *job) {
			delete(dependency.conflictedBy, j)
			if dependency.isOrphan() {
				defer tr.delete(dependency)
			}
		},
	} {
		for dep := range *deps {
			f(dep)
		}
	}
}
func ( tr * transaction ) delete ( j * job ) { log . WithField ( " " , j ) . Debug ( " " ) delete ( tr . merged , j . unit ) for deps , f := range map [ * set ] func ( * job ) { & j . wantedBy : func ( depender * job ) { delete ( depender . wants , j ) } , & j . requiredBy : func ( depender * job ) { delete ( depender . requires , j ) defer tr . delete ( depender ) } , & j . conflictedBy : func ( depender * job ) { delete ( depender . conflicts , j ) defer tr . delete ( depender ) } , & j . wants : func ( dependency * job ) { delete ( dependency . wantedBy , j ) if dependency . isOrphan ( ) { defer tr . delete ( dependency ) } } , & j . requires : func ( dependency * job ) { delete ( dependency . requiredBy , j ) if dependency . isOrphan ( ) { defer tr . delete ( dependency ) } } , & j . conflicts : func ( dependency * job ) { delete ( dependency . conflictedBy , j ) if dependency . isOrphan ( ) { defer tr . delete ( dependency ) } } , } { for dep := range * deps { f ( dep ) } } }
deletes j from transaction
removes all references to j
recurses on orphaned and broken jobs
deletes j from transaction removes all references to j recurses on orphaned and broken jobs