mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +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