From ec07aec522cc958b42fb16a90702592af5531565 Mon Sep 17 00:00:00 2001 From: Marcus Denker Date: Wed, 8 Jul 2020 09:43:27 +0200 Subject: [PATCH] Improve ReGlobalVariablesUsageRule - use #isGlobalVariable on the semantic info - introduce fast #hasClassOrTraitNamed:, we have already hasClassNamed: and use that --- src/System-Support/SystemDictionary.class.st | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/System-Support/SystemDictionary.class.st b/src/System-Support/SystemDictionary.class.st index 570672b585f..dc48ae60d35 100644 --- a/src/System-Support/SystemDictionary.class.st +++ b/src/System-Support/SystemDictionary.class.st @@ -265,6 +265,16 @@ SystemDictionary >> hasClassNamed: aString [ ^ false ] +{ #category : #'classes and traits' } +SystemDictionary >> hasClassOrTraitNamed: aString [ + "Answer whether there is a class of the given name, but don't intern aString if it's not alrady interned." + + Symbol + hasInterned: aString + ifTrue: [:aSymbol | ^ (self at: aSymbol ifAbsent: [nil]) isClassOrTrait]. + ^ false +] + { #category : #'system attributes' } SystemDictionary >> maxIdentityHash [ "Answer the maximum identityHash value supported by the VM."