From 640c96ce38463fad72a2f6aa0f817b569cd4cad4 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 30 May 2018 13:40:25 +0200 Subject: [PATCH] Little tweak to speed up the tab/space method --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/a_Get.php | 16 +++++++++++++++- componentbuilder.xml | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a832ef41..57d06d7cf 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 29th May, 2018 ++ *Last Build*: 30th May, 2018 + *Version*: 2.8.0 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/README.txt b/admin/README.txt index 1a832ef41..57d06d7cf 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -125,7 +125,7 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 29th May, 2018 ++ *Last Build*: 30th May, 2018 + *Version*: 2.8.0 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index aaef4258f..3798a291d 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -662,6 +662,13 @@ class Get */ public $setTidyWarning = false; + /** + * Tab/spacer bucket (to speed-up the build) + * + * @var array + */ + public $tabSpacerBucket = array(); + /** * Set tab/spacer * @@ -769,7 +776,14 @@ class Get */ public function _t($nr) { - return str_repeat($this->tabSpacer, (int) $nr); + // check if we already have the string + if (!isset($this->tabSpacerBucket[$nr])) + { + // get the string + $this->tabSpacerBucket[$nr] = str_repeat($this->tabSpacer, (int) $nr); + } + // return stored string + return $this->tabSpacerBucket[$nr]; } /** diff --git a/componentbuilder.xml b/componentbuilder.xml index cc5da0916..b7492a831 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 29th May, 2018 + 30th May, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com