From b9bcc694b89eb7cb3804439053d02b0cf8cc7eda Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 5 Dec 2024 17:55:06 +0100 Subject: [PATCH] Speedup #isRoot This will speedup the Python parser during the resolution of imports --- src/Moose-Query/TEntityMetaLevelDependency.trait.st | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Moose-Query/TEntityMetaLevelDependency.trait.st b/src/Moose-Query/TEntityMetaLevelDependency.trait.st index 4f8437d5..7dddb3bf 100644 --- a/src/Moose-Query/TEntityMetaLevelDependency.trait.st +++ b/src/Moose-Query/TEntityMetaLevelDependency.trait.st @@ -707,12 +707,15 @@ TEntityMetaLevelDependency >> isQueryable [ { #category : #testing } TEntityMetaLevelDependency >> isRoot [ + "Old implementation: self parents isEmpty + This implementation is faster." - ^ self parents isEmpty + self parentsDo: [ :parent | ^ false ]. + ^ true ] { #category : #accessing }