summaryrefslogtreecommitdiffstats
path: root/tests/core/object/test_object.h
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-04-15 15:18:34 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-05-04 16:08:55 +0200
commit955d5affa857ec1f358c56da8fb1ff4ab6590704 (patch)
treeb667ac9f6f62bff17ce032683c0eb09727660555 /tests/core/object/test_object.h
parent7ebc866418b075df58cbe4e31fcf8b0c3acd70a1 (diff)
downloadredot-engine-955d5affa857ec1f358c56da8fb1ff4ab6590704.tar.gz
Reduce and prevent unnecessary random-access to `List`
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when accessing a single element) * Removed subscript operator, in favor of a more explicit `get` * Added conversion from `Iterator` to `ConstIterator` * Remade existing operations into other solutions when applicable
Diffstat (limited to 'tests/core/object/test_object.h')
-rw-r--r--tests/core/object/test_object.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/core/object/test_object.h b/tests/core/object/test_object.h
index 3a3013a102..d714d71416 100644
--- a/tests/core/object/test_object.h
+++ b/tests/core/object/test_object.h
@@ -142,7 +142,7 @@ TEST_CASE("[Object] Core getters") {
inheritance_list.size() == 1,
"The inheritance list should consist of Object only");
CHECK_MESSAGE(
- inheritance_list[0] == "Object",
+ inheritance_list.front()->get() == "Object",
"The inheritance list should consist of Object only");
}