impl all
This commit is contained in:
@@ -12,7 +12,7 @@ func NewFile(p string) (File, error) {
|
||||
return f, err
|
||||
}
|
||||
|
||||
func (file File) Deltas(likes ...Like) ([]Delta, error) {
|
||||
func (file File) Deltas(like ...Like) ([]Delta, error) {
|
||||
transactions, err := file.transactions()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -20,14 +20,7 @@ func (file File) Deltas(likes ...Like) ([]Delta, error) {
|
||||
result := make([]Delta, 0, len(transactions)*2)
|
||||
for _, transaction := range transactions {
|
||||
for _, delta := range newDeltas(transaction) {
|
||||
if got := func() bool {
|
||||
for _, like := range likes {
|
||||
if !like(delta) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}(); !got {
|
||||
if !likes(like).all(delta) {
|
||||
continue
|
||||
}
|
||||
result = append(result, delta)
|
||||
|
||||
Reference in New Issue
Block a user