Skip to content

Commit

Permalink
移除重复的锁
Browse files Browse the repository at this point in the history
  • Loading branch information
steden committed Apr 5, 2024
1 parent 5078e2b commit c58ae8e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions enumerable.go
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,6 @@ func (receiver Enumerable[T]) ToList() List[T] {
if receiver.lock == nil {
return NewList[T]()
}
receiver.lock.RLock()
defer receiver.lock.RUnlock()

return NewList(*receiver.source...)
}
Expand Down Expand Up @@ -866,8 +864,6 @@ func (receiver Enumerable[T]) ToListAny() ListAny {
if receiver.lock == nil {
return lst
}
receiver.lock.RLock()
defer receiver.lock.RUnlock()

array := receiver.ToArray()
for _, item := range array {
Expand Down

0 comments on commit c58ae8e

Please sign in to comment.