1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-23 11:45:38 +01:00

loop on reset with range instead of clear

This commit is contained in:
Kyle Spearrin 2019-07-29 22:35:42 -04:00
parent 7a7ab7bd0e
commit 431804ea80

View File

@ -30,7 +30,16 @@ namespace Bit.Core.Utilities
public void ResetWithRange(IEnumerable<T> range)
{
Items.Clear();
// Maybe a fix for https://forums.xamarin.com/discussion/19114/invalid-number-of-rows-in-section
// Items.Clear();
if(Items.Count > 0)
{
var count = Items.Count;
for(var i = 0; i < count; i++)
{
Items.RemoveAt(0);
}
}
AddRange(range);
}
}