mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
loop on reset with range instead of clear
This commit is contained in:
parent
7a7ab7bd0e
commit
431804ea80
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue