From 50e5727d8168fe11662ff49adfa473c503ff333d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Overg=C3=A5rd=20Nielsen?= Date: Wed, 3 May 2023 14:06:02 +0200 Subject: [PATCH] Iterable.elementAt must be overriden to get good performance --- lib/src/results.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/results.dart b/lib/src/results.dart index b90f40dab..345a1f9e9 100644 --- a/lib/src/results.dart +++ b/lib/src/results.dart @@ -39,7 +39,11 @@ class RealmResults extends collection.IterableBase with Re } /// Returns the element of type `T` at the specified [index]. - T operator [](int index) { + T operator [](int index) => elementAt(index); + + /// Returns the element of type `T` at the specified [index]. + @override + T elementAt(int index) { if (this is RealmResults) { final handle = realmCore.resultsGetObjectAt(this, index); final accessor = RealmCoreAccessor(metadata, realm.isInMigration);