Skip to content

Commit 66a8576

Browse files
authored
fix: Revert "perf: Improve performance" (#21)
This reverts commit 3354b55.
1 parent 3354b55 commit 66a8576

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Adapters/DatabaseAdapter.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ public function removePolicy(string $sec, string $ptype, array $rule): void
154154
$instance->where('v'.strval($key), $value);
155155
}
156156

157-
$instance->delete();
157+
foreach ($instance->get() as $model) {
158+
if ($model->delete()) {
159+
++$count;
160+
}
161+
}
158162
}
159163

160164
/**
@@ -206,7 +210,11 @@ public function removeFilteredPolicy(string $sec, string $ptype, int $fieldIndex
206210
}
207211
}
208212

209-
$instance->delete();
213+
foreach ($instance->get() as $model) {
214+
if ($model->delete()) {
215+
++$count;
216+
}
217+
}
210218
}
211219

212220
/**

0 commit comments

Comments
 (0)