Skip to content

Commit 014e221

Browse files
committed
simplify getlocks local
1 parent 2d5a4fa commit 014e221

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/services/local/access.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,7 @@ func (s *AccessService) matchLock(lock types.Lock, filter *types.LockFilter) (ty
307307

308308
// GetLocks gets all/in-force locks that match at least one of the targets when specified.
309309
func (s *AccessService) GetLocks(ctx context.Context, inForceOnly bool, targets ...types.LockTarget) ([]types.Lock, error) {
310-
targetPtrs := make([]*types.LockTarget, len(targets))
311-
for i := range targets {
312-
targetPtrs[i] = &targets[i]
313-
}
314-
return stream.Collect(s.RangeLocks(ctx, "", "", &types.LockFilter{
315-
InForceOnly: inForceOnly,
316-
Targets: targetPtrs,
317-
}))
310+
return stream.Collect(s.RangeLocks(ctx, "", "", types.NewLockFilter(inForceOnly, targets...)))
318311
}
319312

320313
// RangeLocks returns Snowflake session resources within the range [start, end).

0 commit comments

Comments
 (0)