< Summary

Class:MainScripts.DCL.Helpers.Utils.PoolUtilsListPoolRent[T]
Assembly:Utils
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/PoolUtils.cs
Covered lines:6
Uncovered lines:0
Coverable lines:6
Total lines:31
Line coverage:100% (6 of 6)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetList()0%110100%
ListPoolRent(...)0%110100%
Dispose()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Helpers/Utils/PoolUtils.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using UnityEngine.Pool;
 4
 5namespace MainScripts.DCL.Helpers.Utils
 6{
 7    public static class PoolUtils
 8    {
 9        public struct ListPoolRent<T> : IDisposable
 10        {
 11            private List<T> list;
 12
 13            public List<T> GetList() =>
 38414                list;
 15
 16            public ListPoolRent(List<T> list)
 17            {
 19218                this.list = list;
 19219            }
 20
 21            public void Dispose()
 22            {
 19223                ListPool<T>.Release(list);
 19224                list = null;
 19225            }
 26        }
 27
 28        public static ListPoolRent<T> RentList<T>() =>
 29            new ListPoolRent<T>(ListPool<T>.Get());
 30    }
 31}