From a93fc665255dad6ed3709382516517fa6984a89e Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 22 Aug 2025 17:18:32 +0000 Subject: Speed up TclOO init; no directing via unknown method handler for slots of classes we define ourselves (backport) --- generic/tclOOScript.h | 8 ++++---- tools/tclOOScript.tcl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tclOOScript.h b/generic/tclOOScript.h index 7b8a69d..a9b262c 100644 --- a/generic/tclOOScript.h +++ b/generic/tclOOScript.h @@ -210,8 +210,8 @@ static const char *tclOOSetupScript = "\t\t::oo::UpdateClassDelegatesAfterClone $originObject [self]\n" "\t}\n" "\tclass create singleton {\n" -"\t\tsuperclass class\n" -"\t\tvariable object\n" +"\t\tsuperclass -set class\n" +"\t\tvariable -set object\n" "\t\tunexport create createWithNamespace\n" "\t\tmethod new args {\n" "\t\t\tif {![info exists object] || ![info object isa object $object]} {\n" @@ -231,7 +231,7 @@ static const char *tclOOSetupScript = "\t\t}\n" "\t}\n" "\tclass create abstract {\n" -"\t\tsuperclass class\n" +"\t\tsuperclass -set class\n" "\t\tunexport create createWithNamespace new\n" "\t}\n" "\tnamespace eval configuresupport::configurableclass {\n" @@ -249,7 +249,7 @@ static const char *tclOOSetupScript = "\t\tdefinitionnamespace -class configuresupport::configurableclass\n" "\t}\n" "\tclass create configurable {\n" -"\t\tsuperclass class\n" +"\t\tsuperclass -set class\n" "\t\tconstructor {{definitionScript \"\"}} {\n" "\t\t\tnext {mixin ::oo::configuresupport::configurable}\n" "\t\t\tnext $definitionScript\n" diff --git a/tools/tclOOScript.tcl b/tools/tclOOScript.tcl index 442756d..542b711 100644 --- a/tools/tclOOScript.tcl +++ b/tools/tclOOScript.tcl @@ -372,8 +372,8 @@ # ---------------------------------------------------------------------- class create singleton { - superclass class - variable object + superclass -set class + variable -set object unexport create createWithNamespace method new args { if {![info exists object] || ![info object isa object $object]} { @@ -403,7 +403,7 @@ # ---------------------------------------------------------------------- class create abstract { - superclass class + superclass -set class unexport create createWithNamespace new } @@ -486,7 +486,7 @@ # ---------------------------------------------------------------------- class create configurable { - superclass class + superclass -set class constructor {{definitionScript ""}} { next {mixin ::oo::configuresupport::configurable} -- cgit v0.12